feat: add refresh token and global exception filter

This commit is contained in:
2026-05-09 09:00:25 +03:30
parent 06f659101d
commit 73f7af3146
32 changed files with 512 additions and 42 deletions
@@ -0,0 +1,24 @@
import { RedisService } from '@/common/modules/redis/providers/redis.service';
import { Injectable } from '@nestjs/common';
@Injectable()
export class AuthRedisProvider {
constructor(
/**
* Injecting Redis Service
*/
private readonly redisService: RedisService,
) {}
async storeRefreshToken(jti: string, userId: number, ttl: number) {
await this.redisService.set(`rt:${jti}`, userId.toString(), ttl);
}
async hasRefreshToken(jti: string) {
return !!(await this.redisService.get(`rt:${jti}`));
}
async revokeRefreshToken(jti: string) {
await this.redisService.del(`rt:${jti}`);
}
}