diff --git a/backend/src/api/controllers/user.ts b/backend/src/api/controllers/user.ts index 06f4a5b86..4006d8f2e 100644 --- a/backend/src/api/controllers/user.ts +++ b/backend/src/api/controllers/user.ts @@ -116,7 +116,7 @@ export async function sendVerificationEmail( if (e.code === "auth/user-not-found") { throw new MonkeyError( 500, - "Auth user not found when the user was found in the database", + "Auth user not found when the user was found in the database. Contact support with this error message and your email", JSON.stringify({ decodedTokenEmail: email, userInfoEmail: userInfo.email, @@ -125,6 +125,12 @@ export async function sendVerificationEmail( userInfo.uid ); } + if (e.message.includes("Internal error encountered.")) { + throw new MonkeyError( + 500, + "Firebase failed to generate an email verification link. Please try again later." + ); + } throw e; }