mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-24 05:32:03 +10:00
🚀 release: v3.0.0
This commit is contained in:
5
apps/server/src/auth/guards/jwt.guard.ts
Normal file
5
apps/server/src/auth/guards/jwt.guard.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
|
||||
@Injectable()
|
||||
export class JwtAuthGuard extends AuthGuard('jwt') {}
|
||||
5
apps/server/src/auth/guards/local.guard.ts
Normal file
5
apps/server/src/auth/guards/local.guard.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
|
||||
@Injectable()
|
||||
export class LocalAuthGuard extends AuthGuard('local') {}
|
||||
11
apps/server/src/auth/guards/optional-jwt.guard.ts
Normal file
11
apps/server/src/auth/guards/optional-jwt.guard.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
|
||||
import { User } from '@/users/entities/user.entity';
|
||||
|
||||
@Injectable()
|
||||
export class OptionalJwtAuthGuard extends AuthGuard('jwt') {
|
||||
handleRequest<TUser = User>(err: Error, user: TUser): TUser {
|
||||
return user;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user