-
Notifications
You must be signed in to change notification settings - Fork 68
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
Enable the resendVerificationEmail Next.js action to work with email … #846
Enable the resendVerificationEmail Next.js action to work with email … #846
Conversation
@@ -145,6 +145,13 @@ export class Auth { | |||
}); | |||
} | |||
|
|||
async resendVerificationEmailForEmail(email: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think have this separate makes for cleaner code.
@@ -135,14 +135,33 @@ export class NextAppAuth extends NextAuth { | |||
return tokenData; | |||
}, | |||
emailPasswordResendVerificationEmail: async ( | |||
data: FormData | { verification_token: string } | |||
data: FormData | { verification_token: string } | { email: string } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept this in single action, as adding another action would require more docs changes, and potentially would be confusing to have 2 calls for 1 endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick turnaround here 🙏
@@ -145,6 +145,13 @@ export class Auth { | |||
}); | |||
} | |||
|
|||
async resendVerificationEmailForEmail(email: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought a bit about how we might be able to support this format directly on resendVerificationEmail
, but I think I prefer the direction you've taken this here by making it just a separate function. Moves the complexity into the consumer.
…param. (#845)
I've tested locally that the server endpoint work just with the
email
param: