feat: add jwt auth guard and profile endpoint
This commit is contained in:
@@ -2,6 +2,7 @@ import { Body, Controller, HttpCode, Post } from '@nestjs/common';
|
||||
import { LoginDTO } from './dtos/login.dto';
|
||||
import { AuthService } from './providers/auth.service';
|
||||
import { VerifyOtpDTO } from './dtos/verify-otp.dto';
|
||||
import { Public } from './decorators/public.decorator';
|
||||
|
||||
@Controller('users')
|
||||
export class AuthController {
|
||||
@@ -12,12 +13,14 @@ export class AuthController {
|
||||
private readonly authService: AuthService,
|
||||
) {}
|
||||
|
||||
@Public()
|
||||
@Post('login')
|
||||
@HttpCode(200)
|
||||
public async logIn(@Body() loginDto: LoginDTO) {
|
||||
return await this.authService.logIn(loginDto);
|
||||
}
|
||||
|
||||
@Public()
|
||||
@Post('verify-otp')
|
||||
@HttpCode(200)
|
||||
public async verifyOTP(@Body() verifyOtpDto: VerifyOtpDTO) {
|
||||
|
||||
Reference in New Issue
Block a user