Skip to content

Commit

Permalink
💚 Fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mit-27 committed Apr 29, 2024
1 parent 9ddfaad commit 502603d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/api/src/@core/auth/guards/jwt-auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ import {
UnauthorizedException,
} from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { Observable } from 'rxjs';

@Injectable()
export class JwtAuthGuard extends AuthGuard('jwt') {
canActivate(context: ExecutionContext) {
// Add your custom authentication logic here
// for example, call super.logIn(request) to establish a session.

canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> {
return super.canActivate(context);
}

handleRequest(err, user, info) {
// You can throw an exception based on either "info" or "err" arguments
handleRequest<TUser = any>(err: any, user: any, info: any, context: ExecutionContext, status?: any): TUser {
if (err || !user) {
throw err || new UnauthorizedException();
}
Expand Down

0 comments on commit 502603d

Please sign in to comment.