Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Add parseInt to token expiration

Tuan Dang3d25baa319dd
diff --git a/backend/src/helpers/signup.ts b/backend/src/helpers/signup.ts
index e26b9b3606..141bf455d5 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 7ac996cb65..9bf8836f5a 100644
--- a/backend/src/models/token.ts
+++ b/backend/src/models/token.ts
@@ -18,7 +18,7 @@ const tokenSchema = new Schema<IToken>({
},
createdAt: {
type: Date,
- expires: EMAIL_TOKEN_LIFETIME,
+ expires: parseInt(EMAIL_TOKEN_LIFETIME),
default: Date.now
}
});