clean routes
This commit is contained in:
@@ -3,10 +3,11 @@ import { getHttpRequestContext } from '@adapters/http/RequestContext';
|
||||
export type Actor = {
|
||||
userId: string;
|
||||
driverId: string;
|
||||
role?: string | undefined;
|
||||
};
|
||||
|
||||
type AuthenticatedRequest = {
|
||||
user?: { userId: string };
|
||||
user?: { userId: string; role?: string };
|
||||
};
|
||||
|
||||
export function getActorFromRequestContext(): Actor {
|
||||
@@ -21,5 +22,6 @@ export function getActorFromRequestContext(): Actor {
|
||||
// Current canonical mapping:
|
||||
// - The authenticated session identity is `userId`.
|
||||
// - In the current system, that `userId` is also treated as the performer `driverId`.
|
||||
return { userId, driverId: userId };
|
||||
// - Include role from session if available
|
||||
return { userId, driverId: userId, role: req.user?.role };
|
||||
}
|
||||
Reference in New Issue
Block a user