refactor(db/models): change jwt expiry time
This commit is contained in:
parent
05d11e0ea5
commit
2aae7ea2c4
@ -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",
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user