import { BadRequestException, Body, Controller, Header, HttpCode, HttpStatus, Logger, Post, } from '@nestjs/common'; import { AuthService } from './auth.service'; import { LoginDTO } from '../dtos/loginDTO'; @Controller('auth') export class AuthController { constructor(private readonly authService: AuthService) {} @HttpCode(HttpStatus.OK) @Post('login') @Header('content-type', 'application/json') login(@Body() loginDto: LoginDTO): Promise { Logger.log('/auth/loin/', 'requested'); if (loginDto) { return this.authService.signIn(loginDto); } else { throw new BadRequestException(); } } }