Skip to content

Commit

Permalink
Pass verify_url in resendVerificationEmail Next server action (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroslavPetrik authored Feb 2, 2024
1 parent 265e172 commit 6c82e07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/auth-core/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,11 @@ export class Auth {
});
}

async resendVerificationEmailForEmail(email: string) {
async resendVerificationEmailForEmail(email: string, verifyUrl: string) {
await this._post("resend-verification-email", {
provider: emailPasswordProviderName,
email,
verify_url: verifyUrl,
});
}

Expand Down
7 changes: 6 additions & 1 deletion packages/auth-nextjs/src/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@ export class NextAppAuth extends NextAuth {
if (verificationToken) {
await (await this.core).resendVerificationEmail(verificationToken);
} else if (email) {
await (await this.core).resendVerificationEmailForEmail(email);
await (
await this.core
).resendVerificationEmailForEmail(
email,
`${this._authRoute}/emailpassword/verify`
);
}
},
};
Expand Down

0 comments on commit 6c82e07

Please sign in to comment.