Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions backend/src/modules/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,18 @@ export class AuthService {
throw new Error('Usuário não encontrado ou inativo');
}

// Verificar se o token está na blacklist
const isBlacklisted = await this.isTokenBlacklisted(token);
if (isBlacklisted) {
throw new Error('Token inválido ou expirado');
}

return decoded;
} catch (error) {
Logger.error('Erro ao verificar token', error);
if (error instanceof Error && error.message === 'Token inválido ou expirado') {
throw error;
}
throw new Error('Token inválido');
}
}
Expand Down
Loading