2 Commits

Author SHA1 Message Date
2b8d7d5ae2 switching auth strategy to oidc 2025-08-26 21:08:05 -05:00
7933198403 switching auth strategy to oidc 2025-08-26 21:07:32 -05:00
3 changed files with 0 additions and 16 deletions

View File

@@ -1,7 +1,6 @@
import { ExecutionContext, Injectable } from '@nestjs/common'; import { ExecutionContext, Injectable } from '@nestjs/common';
import { AuthGuard as PassportAuthGuard } from '@nestjs/passport'; import { AuthGuard as PassportAuthGuard } from '@nestjs/passport';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { IS_PUBLIC_KEY } from '../decorators/public.decorator';
@Injectable() @Injectable()
export class AuthGuard extends PassportAuthGuard('oidc') { export class AuthGuard extends PassportAuthGuard('oidc') {
@@ -10,13 +9,6 @@ export class AuthGuard extends PassportAuthGuard('oidc') {
} }
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> { canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> {
const isPublic = this.reflector.get<boolean>(
IS_PUBLIC_KEY,
context.getHandler()
)
if (isPublic) return true;
return super.canActivate(context); return super.canActivate(context);
} }
} }

View File

@@ -1,4 +0,0 @@
import { SetMetadata } from "@nestjs/common";
export const IS_PUBLIC_KEY = "isPublic";
export const Public = () => SetMetadata(IS_PUBLIC_KEY, true);

View File

@@ -8,10 +8,6 @@ export * from './auth/public.decorator';
export * from './util/customError'; export * from './util/customError';
// Decorators
export { IS_PUBLIC_KEY, Public } from './decorators/public.decorator'
// User // User
export * from './user/user.module'; export * from './user/user.module';