fix auth token expiration
This commit is contained in:
@@ -39,7 +39,10 @@ export class TokensService {
|
||||
}
|
||||
|
||||
private generateAccessToken(payload: ITokenPayload | IAdminTokenPayload, expiresIn: number) {
|
||||
return this.jwtService.signAsync(payload, { expiresIn });
|
||||
// Ensure expiresIn is passed as a string with time unit for reliability
|
||||
// JWT library accepts: number (seconds) or string with unit (e.g., "3600s", "1h")
|
||||
// Using string format is more explicit and prevents unit confusion
|
||||
return this.jwtService.signAsync(payload, { expiresIn: `${expiresIn}s` });
|
||||
}
|
||||
|
||||
async storeRefreshToken(ownerId: string, restId: string, refreshToken: string, type: RefreshTokenType) {
|
||||
|
||||
Reference in New Issue
Block a user