Controlador
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user