feat: add admin guard and JWT role support
- Create AdminGuard to check user role - Update JWT strategy to include role in payload - Update auth service to include role in token generation - Prepare admin module structure - TypeScript will resolve lint errors after server restart
This commit is contained in:
4
apps/api/dist/auth/jwt.strategy.d.ts
vendored
4
apps/api/dist/auth/jwt.strategy.d.ts
vendored
@@ -2,10 +2,11 @@ import { Strategy } from 'passport-jwt';
|
||||
export interface JwtPayload {
|
||||
sub: string;
|
||||
email: string;
|
||||
role?: string;
|
||||
iat?: number;
|
||||
exp?: number;
|
||||
}
|
||||
declare const JwtStrategy_base: new (...args: [opt: import("passport-jwt").StrategyOptionsWithRequest] | [opt: import("passport-jwt").StrategyOptionsWithoutRequest]) => Strategy & {
|
||||
declare const JwtStrategy_base: new (...args: [opt: import("passport-jwt").StrategyOptionsWithoutRequest] | [opt: import("passport-jwt").StrategyOptionsWithRequest]) => Strategy & {
|
||||
validate(...args: any[]): unknown;
|
||||
};
|
||||
export declare class JwtStrategy extends JwtStrategy_base {
|
||||
@@ -13,6 +14,7 @@ export declare class JwtStrategy extends JwtStrategy_base {
|
||||
validate(payload: JwtPayload): Promise<{
|
||||
userId: string;
|
||||
email: string;
|
||||
role: string;
|
||||
}>;
|
||||
}
|
||||
export {};
|
||||
|
||||
Reference in New Issue
Block a user