diff --git a/backend/src/helpers/signup.ts b/backend/src/helpers/signup.ts index e26b9b360..141bf455d 100644 --- a/backend/src/helpers/signup.ts +++ b/backend/src/helpers/signup.ts @@ -66,7 +66,7 @@ const checkEmailVerification = async ({ email, token: code }); - + if (!token) throw new Error('Failed to find email verification token'); } catch (err) { Sentry.setUser(null); diff --git a/backend/src/models/token.ts b/backend/src/models/token.ts index 7ac996cb6..9bf8836f5 100644 --- a/backend/src/models/token.ts +++ b/backend/src/models/token.ts @@ -18,7 +18,7 @@ const tokenSchema = new Schema({ }, createdAt: { type: Date, - expires: EMAIL_TOKEN_LIFETIME, + expires: parseInt(EMAIL_TOKEN_LIFETIME), default: Date.now } });