fixed forgot password

This commit is contained in:
unknown
2024-10-21 14:18:31 +03:00
parent 07ac955eb0
commit f165e8ce3a
3 changed files with 11 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import { ForgetPasswordDto, UserOtpDto, VerifyOtpDto } from '../dtos';
import { RefreshTokenGuard } from '@app/common/guards/jwt-refresh.auth.guard';
import { SuperAdminRoleGuard } from 'src/guards/super.admin.role.guard';
import { EnableDisableStatusEnum } from '@app/common/constants/days.enum';
import { OtpType } from '@app/common/constants/otp-type.enum';
@Controller({
version: EnableDisableStatusEnum.ENABLED,
@ -74,6 +75,11 @@ export class UserAuthController {
@Post('user/forget-password')
async forgetPassword(@Body() forgetPasswordDto: ForgetPasswordDto) {
await this.userAuthService.verifyOTP({
otpCode: forgetPasswordDto.otpCode,
email: forgetPasswordDto.email,
type: OtpType.PASSWORD,
});
await this.userAuthService.forgetPassword(forgetPasswordDto);
return {
statusCode: HttpStatus.OK,