RFC: Resend email verification (Auth) #13056
GermanJablo
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem:
If a user is created but does not verify their email, and later attempts to sign up again, there's currently no built-in way to handle this flow. Developers need to manually check if the user exists, regenerate the token, and resend the email, all of which is verbose, error-prone, and easy to forget entirely.
Possible Solutions
1.
payload.sendVerificationEmail
This method would allow you to manually resend the email by reusing
generateEmailHTML
andgenerateEmailSubject
, avoiding the complex logic surrounding tokens. However, users still have to remember to handle the case where the user was registered but not validated before calling this method. As I mentioned, it's easy to forget to do this, and there's no dedicated error status code to easily identify it.2. New property in
auth.verify
A tentative example:
3. New
payload.signup
methodIt would be analogous to the
payload.login
method we already have, and could lay the groundwork for other, more advanced auth flows.In either case, we'll likely need to revise the returned statuses to reflect the different scenarios. A suggestion:
Beta Was this translation helpful? Give feedback.
All reactions