refacto iat for jwt
This commit is contained in:
parent
c1db9610ca
commit
ecf1a29c15
@ -84,11 +84,11 @@ export default class AuthService extends BaseService {
|
||||
};
|
||||
}
|
||||
public generateAccessToken(user: any): string {
|
||||
return jwt.sign({ ...user }, this.variables.ACCESS_TOKEN_SECRET, { expiresIn: "15m" });
|
||||
return jwt.sign({ ...user, iat: Math.floor(Date.now() / 1000)}, this.variables.ACCESS_TOKEN_SECRET, { expiresIn: "15m" });
|
||||
}
|
||||
|
||||
public generateRefreshToken(user: any): string {
|
||||
return jwt.sign({ ...user }, this.variables.REFRESH_TOKEN_SECRET, { expiresIn: "1h" });
|
||||
return jwt.sign({ ...user, iat: Math.floor(Date.now() / 1000)}, this.variables.REFRESH_TOKEN_SECRET, { expiresIn: "1h" });
|
||||
}
|
||||
|
||||
public verifyAccessToken(token: string, callback?: VerifyCallback) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user