mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Fix email verification errors
This commit is contained in:
parent
59a9df90da
commit
dbc0381a8a
@ -20,15 +20,15 @@ export const POST = deprecatedSmartRouteHandler(async (req: NextRequest) => {
|
||||
});
|
||||
|
||||
if (!codeRecord) {
|
||||
throw new KnownErrors.PasswordResetCodeNotFound();
|
||||
throw new KnownErrors.EmailVerificationCodeNotFound();
|
||||
}
|
||||
|
||||
if (codeRecord.expiresAt < new Date()) {
|
||||
throw new KnownErrors.PasswordResetCodeExpired();
|
||||
throw new KnownErrors.EmailVerificationCodeExpired();
|
||||
}
|
||||
|
||||
if (codeRecord.usedAt) {
|
||||
throw new KnownErrors.PasswordResetCodeAlreadyUsed();
|
||||
throw new KnownErrors.EmailVerificationCodeAlreadyUsed();
|
||||
}
|
||||
|
||||
await prismaClient.projectUser.update({
|
||||
|
||||
@ -99,7 +99,7 @@ function EmailVerificationSection() {
|
||||
buttonText={
|
||||
!user?.primaryEmailVerified ?
|
||||
emailSent ?
|
||||
'Email Sent' :
|
||||
'Email sent!' :
|
||||
'Send Email'
|
||||
: undefined
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user