feat: implementar melhorias na autenticação
- Adicionar refresh tokens para renovação automática de tokens - Implementar controle de sessões simultâneas - Adicionar blacklist de tokens para logout seguro - Implementar rate limiting para proteção contra ataques - Melhorar detecção de IP e identificação de sessão atual - Adicionar endpoints para gerenciamento de sessões - Corrigir inconsistências na validação de usuário - Atualizar configuração Redis com nova conexão
This commit is contained in:
18
src/core/configs/cache/redis-client.adapter.ts
vendored
18
src/core/configs/cache/redis-client.adapter.ts
vendored
@@ -18,7 +18,21 @@ export class RedisClientAdapter implements IRedisClient {
|
||||
await this.redis.set(key, JSON.stringify(value), 'EX', ttlSeconds);
|
||||
}
|
||||
|
||||
async del(key: string): Promise<void> {
|
||||
await this.redis.del(key);
|
||||
async del(key: string): Promise<void>;
|
||||
async del(...keys: string[]): Promise<void>;
|
||||
async del(keyOrKeys: string | string[]): Promise<void> {
|
||||
if (Array.isArray(keyOrKeys)) {
|
||||
await this.redis.del(...keyOrKeys);
|
||||
} else {
|
||||
await this.redis.del(keyOrKeys);
|
||||
}
|
||||
}
|
||||
|
||||
async keys(pattern: string): Promise<string[]> {
|
||||
return this.redis.keys(pattern);
|
||||
}
|
||||
|
||||
async ttl(key: string): Promise<number> {
|
||||
return this.redis.ttl(key);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user