add : forget password
This commit is contained in:
@@ -14,6 +14,8 @@ import { AuthGuards } from "../../common/decorators/auth-guard.decorator";
|
||||
import { RefreshTokenRateLimit, StrictRateLimit } from "../../common/decorators/rate-limit.decorator";
|
||||
import { UserDec } from "../../common/decorators/user.decorator";
|
||||
import { User } from "../users/entities/user.entity";
|
||||
import { ForgetPasswordDto } from "./DTO/forget-password.dto";
|
||||
import { VerifyForgotPasswordOtpDto } from "./DTO/verify-forgot-otp.dto";
|
||||
|
||||
@ApiTags("Auth")
|
||||
@Controller("auth")
|
||||
@@ -22,7 +24,7 @@ export class AuthController {
|
||||
constructor(
|
||||
private readonly authService: AuthService,
|
||||
private readonly ssoService: SSOService,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
@ApiOperation({ summary: "request to login with otp" })
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@@ -92,15 +94,17 @@ export class AuthController {
|
||||
}
|
||||
//***************************** */
|
||||
|
||||
// @Post("forgot-password")
|
||||
// async forgotPassword(@Body() forgotPasswordDto: ForgotPasswordDto) {
|
||||
// return this.authService.forgotPassword(forgotPasswordDto);
|
||||
// }
|
||||
@ApiOperation({ summary: "Generate otp and send vial email" })
|
||||
@Post("forgot-password")
|
||||
async forgotPassword(@Body() dto: ForgetPasswordDto) {
|
||||
return this.authService.requestForgotPasswordOtp(dto);
|
||||
}
|
||||
|
||||
// @Post("reset-password")
|
||||
// async resetPassword(@Body() resetPasswordDto: ResetPasswordDto) {
|
||||
// return this.authService.resetPassword(resetPasswordDto);
|
||||
// }
|
||||
@ApiOperation({ summary: "verify otp and update password" })
|
||||
@Post("reset-password")
|
||||
async resetPassword(@Body() resetPasswordDto: VerifyForgotPasswordOtpDto) {
|
||||
return this.authService.verifyForgotPasswordOtp(resetPasswordDto);
|
||||
}
|
||||
|
||||
@ApiOperation({ summary: "Generate SSO token for client application" })
|
||||
@HttpCode(HttpStatus.OK)
|
||||
|
||||
Reference in New Issue
Block a user