Update backend/src/graphql/resolver/UserResolver.ts

Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de>
This commit is contained in:
Hannes Heine 2022-03-14 16:14:52 +01:00 committed by GitHub
parent 2d4411d390
commit 82e453c27b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,7 +191,7 @@ const getOptInCode = async (loginUserId: number): Promise<LoginEmailOptIn> => {
// Check for 10 minute delay
if (optInCode) {
const timeElapsed = Date.now() - new Date(optInCode.updatedAt).getTime()
if (timeElapsed <= parseInt(CONFIG.EMAIL_CODE_VALID_TIME.toString()) * 60 * 1000) {
if (timeElapsed < parseInt(CONFIG.EMAIL_CODE_VALID_TIME.toString()) * 60 * 1000) {
throw new Error(
'email already sent less than ' +
parseInt(CONFIG.EMAIL_CODE_VALID_TIME.toString()) +