se añadieron los controldores para autorizacion de login
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { Body, Controller, Post, Request, UseGuards } from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Usuario } from 'src/usuario/usuario.entity';
|
||||
import { Repository } from 'typeorm';
|
||||
import { AuthService } from './auth.service';
|
||||
import { LoginUsuarioDto } from './dto/loginUsuario.dto';
|
||||
import { RegistrarUsuarioDto } from './dto/registrarUsuario.dto';
|
||||
|
||||
@Controller('auth')
|
||||
export class AuthController {
|
||||
constructor(
|
||||
private authService: AuthService,
|
||||
) /* @InjectRepository(Usuario) private usuarioRepository: Repository<Usuario> */ {}
|
||||
|
||||
@Post('registro')
|
||||
registrarUsuario(@Body() registrarUsuario: RegistrarUsuarioDto) {
|
||||
return this.authService.registrar(registrarUsuario);
|
||||
}
|
||||
|
||||
@Post('login')
|
||||
login(@Body() LoginUsuario: LoginUsuarioDto) {
|
||||
return this.authService.login(LoginUsuario);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user