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:
dwindown
2025-10-11 14:15:34 +07:00
parent c3bc181063
commit 9b789b333f
26 changed files with 117 additions and 15 deletions

View File

@@ -21,7 +21,7 @@ export declare class AuthController {
avatarUrl: string | null;
emailVerified: boolean;
};
token: string;
token: Promise<string>;
}>;
login(body: {
email: string;
@@ -44,7 +44,7 @@ export declare class AuthController {
avatarUrl: string | null;
emailVerified: boolean;
};
token: string;
token: Promise<string>;
requiresOtp?: undefined;
availableMethods?: undefined;
tempToken?: undefined;
@@ -61,7 +61,7 @@ export declare class AuthController {
avatarUrl: string | null;
emailVerified: boolean;
};
token: string;
token: Promise<string>;
}>;
googleAuth(): Promise<void>;
googleAuthCallback(req: any, res: Response): Promise<void>;