refactor(db/models): change jwt expiry time

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2024-11-11 17:17:46 -05:00
parent 05d11e0ea5
commit 2aae7ea2c4
Signed by: tablet
GPG Key ID: 924A5F6AF051E87C

View File

@ -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",
});
};