create simpel login

This commit is contained in:
TheManus88
2024-09-11 22:35:57 -06:00
parent 6c59c341e7
commit ca79113b62
14 changed files with 373 additions and 14 deletions
+25 -2
View File
@@ -1,4 +1,27 @@
import { Controller } from '@nestjs/common';
import {
BadRequestException,
Body,
Controller,
HttpCode,
HttpStatus,
Logger,
Post,
} from '@nestjs/common';
import { AuthService } from './auth.service';
import { LoginDTO } from '../dtos/loginDTO';
@Controller('auth')
export class AuthController {}
export class AuthController {
constructor(private readonly authService: AuthService) {}
@HttpCode(HttpStatus.OK)
@Post('login')
login(@Body() loginDto: LoginDTO): Promise<any> {
Logger.log('/auth/loin/', 'requested');
if (loginDto) {
return this.authService.signIn(loginDto);
} else {
throw new BadRequestException();
}
}
}