chore(workspace): eradicate all tsc errors and eslint warnings across frontend, admin, and backend
Deploy Canina / deploy (push) Failing after 29s
Deploy Canina / deploy (push) Failing after 29s
This commit is contained in:
1 parent
4659a7b1de
commit
9f11d8fb2d
98 files changed
+1272
-1009
No files matched your search
@@ -3,10 +3,14 @@ import { AuthGuard } from '@nestjs/passport';
|
||||
|
||||
@Injectable()
|
||||
export class JwtAuthGuard extends AuthGuard('jwt') {
|
||||
handleRequest(err: any, user: any, info: any) {
|
||||
handleRequest<TUser = Record<string, unknown>>(
|
||||
err: unknown,
|
||||
user: TUser | false,
|
||||
): TUser {
|
||||
if (err || !user) {
|
||||
throw (
|
||||
err || new UnauthorizedException('لطفا ابتدا وارد حساب کاربری خود شوید')
|
||||
(err as Error) ||
|
||||
new UnauthorizedException('لطفا ابتدا وارد حساب کاربری خود شوید')
|
||||
);
|
||||
}
|
||||
return user;
|
||||
|
||||
Reference in new issue
Block a user