Skip to content

Commit

Permalink
Fix defining emails
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Sep 1, 2024
1 parent 712a5b8 commit 8fa28c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
1 change: 0 additions & 1 deletion resources/dist/filament-two-factor-auth.js
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K
10 changes: 6 additions & 4 deletions src/Http/Livewire/Auth/PasswordReset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand All @@ -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')
Expand All @@ -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'))),
];
}

Expand All @@ -82,4 +84,4 @@ public function render(): View
...$this->getLayoutData(),
]);
}
}
}

0 comments on commit 8fa28c3

Please sign in to comment.