This commit is contained in:
TuNombreDeUsuario
2024-06-12 10:03:59 -06:00
10 changed files with 95 additions and 30 deletions
+8 -2
View File
@@ -13,6 +13,7 @@ import {
} from '@nestjs/common';
import { AuthGuard } from './auth.guard';
import { AuthService } from './auth.service';
import { registerDto } from './dto/registerDto.dto';
@Controller('auth')
export class AuthController {
@@ -20,8 +21,8 @@ export class AuthController {
@HttpCode(HttpStatus.OK)
@Post('login')
signIn(@Body() signInDto: Record<string, any>) {
return this.authService.signIn(signInDto.username, signInDto.password);
signIn(@Body() data: registerDto) {
return this.authService.signIn(data);
}
@UseGuards(AuthGuard)
@@ -30,6 +31,11 @@ export class AuthController {
return req.user;
}
@Post("register")
postRegister(@Body() data: registerDto){
return this.authService.register(data)
}
@Post('Alta')
async create(@Body() createUserDto: Record<string, any>) {
return this.authService.create(createUserDto.username,createUserDto.password);