Files
CRM_Montzar/apps/api/src/platform/platform-auth.controller.ts
T

23 lines
730 B
TypeScript
Raw Normal View History

2026-09-19 21:54:21 +03:30
import { Body, Controller, Get, Post, UseGuards } from '@nestjs/common';
import { CurrentUser } from '../auth/current-user.decorator';
import { PlatformLoginDto } from './dto';
import { PlatformAuthGuard } from './platform-auth.guard';
import { PlatformAuthService } from './platform-auth.service';
import type { PlatformActor } from './platform-jwt.strategy';
@Controller('platform/auth')
export class PlatformAuthController {
constructor(private readonly auth: PlatformAuthService) {}
@Post('login')
login(@Body() dto: PlatformLoginDto) {
return this.auth.login(dto);
}
@Get('me')
@UseGuards(PlatformAuthGuard)
me(@CurrentUser() actor: PlatformActor) {
return this.auth.me(actor.platformAdminId);
}
}