From dbc0381a8aef7ce2a66b9be08e41e537cbabb040 Mon Sep 17 00:00:00 2001 From: Stan Wohlwend Date: Sun, 14 Apr 2024 09:21:16 +0200 Subject: [PATCH] Fix email verification errors --- .../src/app/api/v1/auth/email-verification/route.tsx | 6 +++--- packages/stack/src/components-page/account-settings.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/stack-server/src/app/api/v1/auth/email-verification/route.tsx b/packages/stack-server/src/app/api/v1/auth/email-verification/route.tsx index a7438034f..09ad3bfe8 100644 --- a/packages/stack-server/src/app/api/v1/auth/email-verification/route.tsx +++ b/packages/stack-server/src/app/api/v1/auth/email-verification/route.tsx @@ -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({ diff --git a/packages/stack/src/components-page/account-settings.tsx b/packages/stack/src/components-page/account-settings.tsx index d7ae43f12..b35fc8d6f 100644 --- a/packages/stack/src/components-page/account-settings.tsx +++ b/packages/stack/src/components-page/account-settings.tsx @@ -99,7 +99,7 @@ function EmailVerificationSection() { buttonText={ !user?.primaryEmailVerified ? emailSent ? - 'Email Sent' : + 'Email sent!' : 'Send Email' : undefined }