From 8fa28c3b87c4b70f28bcbced8764e9f0765f1ce4 Mon Sep 17 00:00:00 2001 From: Baspa Date: Sun, 1 Sep 2024 11:28:28 +0200 Subject: [PATCH] Fix defining emails --- composer.json | 2 +- resources/dist/filament-two-factor-auth.js | 1 - src/Http/Livewire/Auth/PasswordReset.php | 10 ++++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 2d58308..e1a4839 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "php": "^8.1", "filament/filament": "^3.0", "filament/support": "^3.2", - "laravel/fortify": "^1.23", + "laravel/fortify": "^1.24", "spatie/laravel-package-tools": "^1.15.0" }, "require-dev": { diff --git a/resources/dist/filament-two-factor-auth.js b/resources/dist/filament-two-factor-auth.js index 38d4cc9..e69de29 100644 --- a/resources/dist/filament-two-factor-auth.js +++ b/resources/dist/filament-two-factor-auth.js @@ -1 +0,0 @@ -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K diff --git a/src/Http/Livewire/Auth/PasswordReset.php b/src/Http/Livewire/Auth/PasswordReset.php index 1a687ed..5ae7a3d 100644 --- a/src/Http/Livewire/Auth/PasswordReset.php +++ b/src/Http/Livewire/Auth/PasswordReset.php @@ -25,6 +25,8 @@ class PasswordReset extends Page implements HasForms public function mount(): void { + $this->email = request()->get('email'); + if (Filament::auth()->check()) { redirect()->intended(Filament::getCurrentPanel()?->getUrl() ?? config('fortify.home')); } @@ -48,7 +50,7 @@ protected function getFormSchema(): array TextInput::make('email') ->label('E-mail') ->afterStateHydrated(function (TextInput $component) { - $component->state(request()->get('email')); + $component->state($this->email); }) ->disabled(), TextInput::make('password') @@ -66,10 +68,10 @@ protected function getFormSchema(): array ->required(), Hidden::make('email') ->extraAttributes(['name' => 'email']) - ->afterStateHydrated(fn ($component) => $component->state(request()->get('email'))), + ->afterStateHydrated(fn($component) => $component->state(request()->get('email'))), Hidden::make('token') ->extraAttributes(['name' => 'token']) - ->afterStateHydrated(fn ($component) => $component->state(request()->route('token'))), + ->afterStateHydrated(fn($component) => $component->state(request()->route('token'))), ]; } @@ -82,4 +84,4 @@ public function render(): View ...$this->getLayoutData(), ]); } -} +} \ No newline at end of file