import { createParamDecorator, ExecutionContext } from '@nestjs/common';
import { Principal } from '../principal';

export const CurrentPrincipal = createParamDecorator(
  (_data: unknown, ctx: ExecutionContext): Principal => ctx.switchToHttp().getRequest().user,
);
