We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5ca2ff commit 36ec982Copy full SHA for 36ec982
backend/src/auth/jwt-auth.guard.ts
@@ -1,5 +1,13 @@
1
-import { Injectable } from '@nestjs/common';
+import { Injectable, ExecutionContext } from '@nestjs/common';
2
import { AuthGuard } from '@nestjs/passport';
3
4
@Injectable()
5
-export class JwtAuthGuard extends AuthGuard('jwt') {}
+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