-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[10.x] Update ResetPassword.php #41109
Conversation
Why was sent to |
@taylorotwell this will fail on 9.x after the test @crynobone sent in earlier today. |
Putting this here for reference. |
With these changes and app without BeforeResetPassword::toMailUsing(function ($notifiable, $token) {
return (new MailMessage)
->subject(__('Reset Password Notification'))
->line(__('You are receiving this email because we received a password reset request for your account.'))
->action(__('Reset Password'), route('custom.password.reset', $token))
->line(__('If you did not request a password reset, no further action is required.'));
}); AfterResetPassword::createUrlUsing(function ($user, string $token) {
return route('custom.password.reset', $token);
});
ResetPassword::toMailUsing(function ($notifiable, $token, $resetUrl) {
return (new MailMessage)
->subject(__('Reset Password Notification'))
->line(__('You are receiving this email because we received a password reset request for your account.'))
->action(__('Reset Password'), $resetUrl)
->line(__('If you did not request a password reset, no further action is required.'));
}); |
@crynobone I adjusted the test |
I don't think I'm going to make this change. I think if you are using toMailUsing it is assumed you will create your own URL within that callback. |
Setting
ResetPassword::createUrlUsing
was useless if also
ResetPassword::toMailUsing
was set.
The resetUrl wasn't calculated by the given ResetPassword::createUrlUsing callback and wasn't passed to the ResetPassword::toMailUsing callback.