Skip to content

Commit

Permalink
Fix empty authorization deemed as valid when skipAuth = false, thanks @…
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrerojosh committed Feb 26, 2021
1 parent f488aab commit 5a1f40f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/guards/auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export class AuthGuard implements CanActivate {
this.extractJwt(request.headers);
const isInvalidJwt = jwt === null || jwt === undefined;

// Auth is not skipped, but no jwt token given, immediate return
if (isUnprotected && isInvalidJwt) {
return true;
// No jwt token given, immediate return
if (isInvalidJwt) {
throw new UnauthorizedException();
}

try {
Expand Down

1 comment on commit 5a1f40f

@stingalleman
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem hahahah

Please sign in to comment.