fix(auth): make JwtPayload email optional, add phone to JWT payload

This commit is contained in:
hailin 2026-03-07 03:21:32 -08:00
parent 96bf5e7390
commit b8128b7a07
2 changed files with 3 additions and 1 deletions

View File

@ -473,6 +473,7 @@ export class AuthService {
const jwtPayload: JwtPayload = { const jwtPayload: JwtPayload = {
sub: user.id, sub: user.id,
email: user.email, email: user.email,
phone: user.phone,
tenantId: user.tenantId, tenantId: user.tenantId,
roles: user.roles, roles: user.roles,
}; };

View File

@ -4,7 +4,8 @@ import { ExtractJwt, Strategy } from 'passport-jwt';
export interface JwtPayload { export interface JwtPayload {
sub: string; sub: string;
email: string; email?: string;
phone?: string;
tenantId: string; tenantId: string;
roles: string[]; roles: string[];
} }