From 2aae7ea2c4e312d333732d2333bdeeeb94a92c31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Mon, 11 Nov 2024 17:17:46 -0500 Subject: [PATCH] refactor(db/models): change jwt expiry time --- models/user.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/user.ts b/models/user.ts index 312b43b..a068e8b 100644 --- a/models/user.ts +++ b/models/user.ts @@ -275,13 +275,13 @@ UserSchema.methods.validPassword = function (password: string): boolean { UserSchema.methods.generateRefreshToken = function (jwtKey: string): string { return jwt.sign({ id: this._id, isAdmin: this.profile.isAdmin }, jwtKey, { - expiresIn: "14 days", + expiresIn: "1h", }); }; UserSchema.methods.generateAccessToken = function (jwtKey: string): string { return jwt.sign({ id: this._id, isAdmin: this.profile.isAdmin }, jwtKey, { - expiresIn: "15m", + expiresIn: "16m", }); };