role perms

This commit is contained in:
2025-11-12 09:28:56 +03:30
parent 046286b559
commit 440c3721ce
31 changed files with 488 additions and 98 deletions
+4 -4
View File
@@ -6,7 +6,7 @@ import { ITokenPayload } from '../interfaces/IToken-payload';
export interface AuthRequest extends Request {
userId: string;
slug: string;
restId: string;
}
@Injectable()
@@ -30,9 +30,9 @@ export class AuthGuard implements CanActivate {
const payload = await this.jwtService.verifyAsync<ITokenPayload>(token, {
secret,
});
request['userId'] = payload.id;
request['slug'] = payload.restId;
console.log('payload', payload);
request['userId'] = payload.userId;
request['restId'] = payload.restId;
} catch {
throw new UnauthorizedException();
}