mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
24 lines
866 B
TypeScript
24 lines
866 B
TypeScript
import { Controller, Get, UseGuards } from '@nestjs/common';
|
|
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
|
|
import { CurrentUser } from '@tria-plc/api-common/modules/auth/decorators/current-user.decorator';
|
|
import { JwtGuard } from '@tria-plc/api-common/modules/auth/services/jwt.guard';
|
|
import type { TCurrentUser } from '@tria-plc/api-common/modules/auth/types/current-user.type';
|
|
|
|
import { FreightMeService } from './freight-me.service';
|
|
|
|
@ApiTags('auth')
|
|
@Controller('me')
|
|
@ApiBearerAuth()
|
|
export class FreightMeController {
|
|
constructor(private readonly freightMeService: FreightMeService) {}
|
|
|
|
@Get()
|
|
@UseGuards(JwtGuard)
|
|
@ApiOperation({
|
|
summary: 'Current user with flat permissionKeys for backoffice gating',
|
|
})
|
|
getMe(@CurrentUser() user: TCurrentUser) {
|
|
return this.freightMeService.getEnrichedProfile(user);
|
|
}
|
|
}
|