How to disable RequestPasswordReset but allow ResetPassword?

I would like to use the built-in ResetPassword class of Filament. However, I do not want my users to be able to request a password reset themselves. They should contact their admin for that, he can then generate a password request which gets sent to the user. How would I achieve this in Filament? I tried something like this: ->passwordReset(requestAction: null, resetAction: ResetPassword::class)
Solution:
Easiest way would be create your own custom password reset.. unless you create a PR to filament core to include (optional) what you like
Jump to solution
5 Replies
Proculair B.V.
Proculair B.V.OP14mo ago
bump :)
Solution
Vp
Vp14mo ago
Easiest way would be create your own custom password reset.. unless you create a PR to filament core to include (optional) what you like
Proculair B.V.
Proculair B.V.OP14mo ago
Okay, I will build something myself then. If it is good enough, I'll try to submit a PR.
toeknee
toeknee14mo ago
Yeah just copy the filament code and have an action on the users page tbh. Fairly simple
Proculair B.V.
Proculair B.V.OP14mo ago
It is probably clear from the answers above, but if you come across this thread and are still confused, below is how I solved the problem. - app/Http/Livewire/ResetPassword.php: Contents copied from vendor/filament/filament/src/Pages/Auth/PasswordReset/ResetPassword.php, do not forget to update the namespace - app/Providers/AuthServiceProvider.php
public function boot(): void
{
ResetPassword::createUrlUsing(fn (User $user, string $token) => URL::signedRoute(
'password-reset.reset',
[
'email' => $user->email,
'token' => $token,
],
now()->addMinutes(config('auth.passwords.users.expire')),
));
}
public function boot(): void
{
ResetPassword::createUrlUsing(fn (User $user, string $token) => URL::signedRoute(
'password-reset.reset',
[
'email' => $user->email,
'token' => $token,
],
now()->addMinutes(config('auth.passwords.users.expire')),
));
}
- routes/web.php
use App\Http\Livewire\ResetPassword;

Route::get('password-reset/reset', ResetPassword::class)
->middleware(['signed'])
->name('password-reset.reset');
use App\Http\Livewire\ResetPassword;

Route::get('password-reset/reset', ResetPassword::class)
->middleware(['signed'])
->name('password-reset.reset');
Want results from more Discord servers?
Add your server