feat: add refresh token and global exception filter
This commit is contained in:
@@ -3,8 +3,9 @@ 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';
|
||||
import { RefreshTokenDTO } from './dtos/refresh-token.dto';
|
||||
|
||||
@Controller('users')
|
||||
@Controller('auth')
|
||||
export class AuthController {
|
||||
constructor(
|
||||
/**
|
||||
@@ -26,4 +27,11 @@ export class AuthController {
|
||||
public async verifyOTP(@Body() verifyOtpDto: VerifyOtpDTO) {
|
||||
return await this.authService.verifyOTP(verifyOtpDto);
|
||||
}
|
||||
|
||||
@Public()
|
||||
@Post('refresh')
|
||||
@HttpCode(200)
|
||||
public async refreshToken(@Body() refreshTokenDto: RefreshTokenDTO) {
|
||||
return await this.authService.refreshToken(refreshTokenDto);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user