You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { Body, Controller, Post } from '@nestjs/common';
|
|
|
|
import { AuthService } from './auth.service';
|
|
|
|
import { CreateUserDto } from 'src/users/dto/create-user.dto';
|
|
|
|
import { LoginUserDto } from 'src/auth/dto/login-user.dto';
|
|
|
|
|
|
|
|
@Controller('auth')
|
|
|
|
export class AuthController {
|
|
|
|
constructor(private readonly authService: AuthService) {}
|
|
|
|
|
|
|
|
@Post('signup')
|
|
|
|
async signup(@Body() dto: CreateUserDto) {
|
|
|
|
return await this.authService.signup(dto);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Post('login')
|
|
|
|
async login(@Body() dto: LoginUserDto) {
|
|
|
|
return await this.authService.login(dto);
|
|
|
|
}
|
|
|
|
}
|