authentication module done

This commit is contained in:
VirajBrainvire
2024-02-26 11:23:44 +05:30
parent 4ffd94ec78
commit 0764793874
75 changed files with 2111 additions and 89 deletions

View File

@ -0,0 +1,11 @@
import { UnauthorizedException } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
export class JwtAuthGuard extends AuthGuard('jwt') {
handleRequest(err, user, info) {
if (err || !user) {
throw err || new UnauthorizedException();
}
return user;
}
}