Route [password.reset] not defined.

Hi guys, I had a Jetstream app and refactored it to Filament. Today I dropped Jetstream / Fortify and when I try to send a password reset link it says
Route [password.reset] not defined.
Route [password.reset] not defined.
class ResetPasswordAction extends Action
{
protected function setUp(): void
{
$this
->name('reset-password')
->label(__('Passwort zurücksetzen'))
->icon('heroicon-o-key')
->requiresConfirmation()
->action(fn (Hotel|User $record, array $data) => $record->sendPasswordResetNotification(Str::random()))
->color('gray')
->after(fn () => Notification::make()
->title(__('Link wurde versandt'))
->body(__('Der Link zum Zurücksetzen des Passworts wurde versandt.'))
->success()
->send()
);
}
}
class ResetPasswordAction extends Action
{
protected function setUp(): void
{
$this
->name('reset-password')
->label(__('Passwort zurücksetzen'))
->icon('heroicon-o-key')
->requiresConfirmation()
->action(fn (Hotel|User $record, array $data) => $record->sendPasswordResetNotification(Str::random()))
->color('gray')
->after(fn () => Notification::make()
->title(__('Link wurde versandt'))
->body(__('Der Link zum Zurücksetzen des Passworts wurde versandt.'))
->success()
->send()
);
}
}
10 Replies
alexanderkroneis
alexanderkroneisOP15mo ago
I even removed filament/filament and ran composer require filament/filament:"^3.0-stable" -W to ensure everything is in place and order.
awcodes
awcodes15mo ago
are you using a Panel?
alexanderkroneis
alexanderkroneisOP15mo ago
Yes, I am
$panel->
...
->databaseNotifications()
->passwordReset()
->emailVerification()
->profile();
$panel->
...
->databaseNotifications()
->passwordReset()
->emailVerification()
->profile();
awcodes
awcodes15mo ago
it's probably not password.reset anymore since it's going through filament. what does php artisan route:list show meaning the middleware could be trying to send it to the wrong route
alexanderkroneis
alexanderkroneisOP15mo ago
php artisan route:list | grep "password"
GET|HEAD admin/password-reset/request ................................................................ filament.admin.auth.password-reset.request › Filament\Pages › RequestPasswordReset
GET|HEAD admin/password-reset/reset ........................................................................... filament.admin.auth.password-reset.reset › Filament\Pages › ResetPassword
GET|HEAD sell-and-report/password-reset/request ............................................ filament.sell-and-report.auth.password-reset.request › Filament\Pages › RequestPasswordReset
GET|HEAD sell-and-report/password-reset/reset ....................................................... filament.sell-and-report.auth.password-reset.reset › Filament\Pages › ResetPassword
php artisan route:list | grep "password"
GET|HEAD admin/password-reset/request ................................................................ filament.admin.auth.password-reset.request › Filament\Pages › RequestPasswordReset
GET|HEAD admin/password-reset/reset ........................................................................... filament.admin.auth.password-reset.reset › Filament\Pages › ResetPassword
GET|HEAD sell-and-report/password-reset/request ............................................ filament.sell-and-report.auth.password-reset.request › Filament\Pages › RequestPasswordReset
GET|HEAD sell-and-report/password-reset/reset ....................................................... filament.sell-and-report.auth.password-reset.reset › Filament\Pages › ResetPassword
That's how I triggered the reset:
->action(fn (Hotel|User $record, array $data) => $record->sendPasswordResetNotification(Str::random()))
->action(fn (Hotel|User $record, array $data) => $record->sendPasswordResetNotification(Str::random()))
awcodes
awcodes15mo ago
But what is the sendPassword method on the record doing? Something in your system sounds left over from jetstream and is trying to use jetstreams routes.
alexanderkroneis
alexanderkroneisOP15mo ago
->action(function (Hotel|User $record) {
$token = app('auth.password.broker')->createToken($record);
$notification = new ResetPassword($token);
$notification->url = Filament::getResetPasswordUrl($token, $record);
$record->notify($notification);
})
->action(function (Hotel|User $record) {
$token = app('auth.password.broker')->createToken($record);
$notification = new ResetPassword($token);
$notification->url = Filament::getResetPasswordUrl($token, $record);
$record->notify($notification);
})
Thank you for your input.
code jam
code jam15mo ago
Where did you get this approach from?
alexanderkroneis
alexanderkroneisOP15mo ago
I found that on Google 😅 I think @leandro_ferreira is the source, but don't pin that on me
Want results from more Discord servers?
Add your server