22 lines
455 B
TypeScript
22 lines
455 B
TypeScript
import type { Request } from 'express';
|
|
|
|
export type AuthTransport = 'cookie' | 'bearer';
|
|
|
|
export interface AuthPrincipal {
|
|
userId: string;
|
|
username: string;
|
|
sessionId: string;
|
|
firstName: string;
|
|
lastName: string;
|
|
email: string | null;
|
|
mustChangePassword: boolean;
|
|
roles: string[];
|
|
permissions: string[];
|
|
transport: AuthTransport;
|
|
}
|
|
|
|
export interface RequestWithContext extends Request {
|
|
requestId: string;
|
|
auth?: AuthPrincipal;
|
|
}
|