import { createParamDecorator, ExecutionContext } from '@nestjs/common'; /** Identité portée par le JWT — jamais de droits (invariant R0) : * la matrice est relue en base par PermissionsGuard. */ export interface AuthenticatedUser { userId: string; roleId: string; } export const CurrentUser = createParamDecorator( (_: unknown, ctx: ExecutionContext): AuthenticatedUser => { return ctx.switchToHttp().getRequest().user; }, );