diff --git a/src/auth-service/models/User.js b/src/auth-service/models/User.js index fd11dade98..0e9285d94d 100644 --- a/src/auth-service/models/User.js +++ b/src/auth-service/models/User.js @@ -835,8 +835,8 @@ UserSchema.methods.createToken = async function () { return userWithDerivedAttributes; } else { const user = userWithDerivedAttributes.data[0]; - // Calculate expiration time (24 hours from now) in seconds - const expirationTime = Math.floor(Date.now() / 1000) + 24 * 60 * 60; + const oneDayExpiry = Math.floor(Date.now() / 1000) + 24 * 60 * 60; + const oneHourExpiry = Math.floor(Date.now() / 1000) + 60 * 60; logObject("user", user); return jwt.sign( { @@ -856,7 +856,7 @@ UserSchema.methods.createToken = async function () { updatedAt: user.updatedAt, rateLimit: user.rateLimit, lastLogin: user.lastLogin, - exp: expirationTime, + exp: oneHourExpiry, }, constants.JWT_SECRET );