Browse Source

fix(api): fix can-modify-api-key-guard from preventing deletion of revoked apiKeys

legacy-ui
isra el 1 year ago
parent
commit
07321df860
  1. 6
      api/src/auth/guards/can-modify-api-key.guard.ts

6
api/src/auth/guards/can-modify-api-key.guard.ts

@ -26,12 +26,6 @@ export class CanModifyApiKey implements CanActivate {
const apiKey = await this.authService.findApiKeyById(apiKeyId) const apiKey = await this.authService.findApiKeyById(apiKeyId)
if (apiKey?.revokedAt) {
throw new HttpException(
{ error: 'Unauthorized' },
HttpStatus.UNAUTHORIZED,
)
}
if ( if (
!!userId && !!userId &&

Loading…
Cancel
Save