Skip to content

Commit

Permalink
Add parseInt to token expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
dangtony98 committed Dec 9, 2022
1 parent a8dfcae commit 3d25baa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/src/helpers/signup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion backend/src/models/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const tokenSchema = new Schema<IToken>({
},
createdAt: {
type: Date,
expires: EMAIL_TOKEN_LIFETIME,
expires: parseInt(EMAIL_TOKEN_LIFETIME),
default: Date.now
}
});
Expand Down

0 comments on commit 3d25baa

Please sign in to comment.