From 3d25baa319ddcbe2010871a739d7c6300c227591 Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Fri, 9 Dec 2022 10:10:38 -0500 Subject: [PATCH] Add parseInt to token expiration --- backend/src/helpers/signup.ts | 2 +- backend/src/models/token.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 } });