Skip to content

Commit 36ec982

Browse files
committed
Disabling authentication for local testing
1 parent f5ca2ff commit 36ec982

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

backend/src/auth/jwt-auth.guard.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
import { Injectable } from '@nestjs/common';
1+
import { Injectable, ExecutionContext } from '@nestjs/common';
22
import { AuthGuard } from '@nestjs/passport';
33

44
@Injectable()
5-
export class JwtAuthGuard extends AuthGuard('jwt') {}
5+
export class JwtAuthGuard extends AuthGuard('jwt') {
6+
canActivate(context: ExecutionContext) {
7+
if (process.env.DISABLE_AUTH === 'true') {
8+
return true;
9+
}
10+
11+
return super.canActivate(context);
12+
}
13+
}

0 commit comments

Comments
 (0)