mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 12:24:54 +00:00
fixed forgot password
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user