apps/recallassess/recallassess-api/src/api/shared/context/request-context.ts
Client Request Context Stores participant authentication and request-specific data for client API endpoints This is request-scoped and isolated per request using AsyncLocalStorage
Properties |
|
constructor()
|
| Optional accessToken |
Type : string
|
|
JWT access token from client request |
| createdAt |
Type : Date
|
|
Timestamp when context was created |
| Optional participantLoggedIn |
Type : literal type
|
|
Authenticated participant information |
| Optional requestHost |
Type : string
|
| Optional requestProtocol |
Type : string
|
| Optional requestUrl |
Type : string
|
|
Request URL information |
export class CLRequestContext {
/**
* JWT access token from client request
*/
accessToken?: string;
/**
* Authenticated participant information
*/
participantLoggedIn?: {
id: number;
company_id: number;
email: string;
first_name: string;
last_name: string;
role: string; // ParticipantRole enum: PARTICIPANT | PARTICIPANT_ADMIN
is_active: boolean;
};
/**
* Request URL information
*/
requestUrl?: string;
requestProtocol?: string;
requestHost?: string;
/**
* Timestamp when context was created
*/
createdAt: Date;
constructor() {
this.createdAt = new Date();
}
}