25 lines
846 B
TypeScript
25 lines
846 B
TypeScript
import { Body, Controller, Post, Request, UseGuards } from '@nestjs/common';
|
|
import { AuthGuard } from '@nestjs/passport';
|
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
import { Repository } from 'typeorm';
|
|
import { AuthService } from './auth.service';
|
|
import { LoginMiembroDto } from './dto/loginMiembro.dto';
|
|
import { RegistrarMiembroDto } from './dto/registrarMiembro.dto';
|
|
|
|
@Controller('auth')
|
|
export class AuthController {
|
|
constructor(
|
|
private authService: AuthService,
|
|
) /* @InjectRepository(Usuario) private usuarioRepository: Repository<Usuario> */ {}
|
|
|
|
@Post('registro')
|
|
registrarUsuario(@Body() registrarMiembro: RegistrarMiembroDto) {
|
|
return this.authService.registrar(registrarMiembro);
|
|
}
|
|
|
|
@Post('login')
|
|
login(@Body() LoginUsuario: LoginMiembroDto) {
|
|
return this.authService.login(LoginUsuario);
|
|
}
|
|
}
|