feat: add logout functionality

This commit is contained in:
2026-10-07 15:36:44 +03:30
parent f3fe1f55e4
commit 195eca1015
9 changed files with 99 additions and 12 deletions
@@ -21,4 +21,14 @@ export class AuthRedisProvider {
async revokeRefreshToken(jti: string) {
await this.redisService.del(`rt:${jti}`);
}
async blacklistAccessToken(jti: string, ttl: number) {
if (ttl <= 0) return;
await this.redisService.set(`at:bl:${jti}`, '1', ttl);
}
async isAccessTokenBlacklisted(jti: string) {
return !!(await this.redisService.get(`at:bl:${jti}`));
}
}