User Set Password after registering User in the panel
Hello all,
I'm building a user resource that enables Admins to register users manually.
When an action is toggled to enable the login, the action triggers the Email Verification process:
Now what I would like to achieve is to enable the user to set a password when he clicks the verify email.
What would be your approach? I don't think fillament has anything under the hood ready for this after looking at the docs, but I may be wrong!
Thank you!
10 Replies
Could you redirect them to the reset password auth page instead of logging them in immediately on verification?
@awcodes you mean the set password after clicking the email? Or just the standard forgotten password page?
Because the standard pages forces the user to go back to the email client
They click the verify link, in that controller you can mark them as verified then redirect them to the forgotten password route. You just have to not log them in when verifying them.
But you should be able to pass their email to the forgotten password route so it knows whose making the request. Guess they’d have do another email then though. But it’s certainly possible to do what your after.
I’ll take a look at the forgotten password logic to see if I can make anything happen.
Will return with feedback soon.
Even if you don’t use it specifically you should still be able to setup a ‘set password’ route and accomplish the same thing.
Yes, with a custom page probably, but I’m looking at how the token is generated/retrieved so I can rely on that logic. Thanks for your input!
@awcodes and I've done it! Followed your logic...
Here's how...
On the form action generate a new token, and pass it to a notification, along with the password reset URL.
Edit the notification, so it isn't the standard one:
`
Now the user gets an email to set his own password!
Awesome, glad you got it working.
Thank you, I've added a parameter to the url, &activation=true, by passing a new page to the AdminPanelProvider, passwordReset method, I can update the text if it's an activation or a regular reset password 🙂
how did you made this?
Hello, finally it wasn't working as expected .. so I ended it up by overwrite the auth pages