public VerifyOTPResponse VerifyingOTP(VerifyOTP onetp, ApiContext apiContext) { _context = (MICAUMContext)DbManager.GetContext(apiContext.ProductType, apiContext.ServerType); var sentotp = _context.TblSendOtp.SingleOrDefault(x => x.UserId == onetp.UserId); if (sentotp.Otp == onetp.Otp) { var user = _context.AspNetUsers.SingleOrDefault(x => x.Id == sentotp.UserId); if (user != null) { user.FirstTimeLogin = 1; } _context.AspNetUsers.Update(user); _context.TblSendOtp.Remove(sentotp); _context.SaveChanges(); return(new VerifyOTPResponse { Status = BusinessStatus.Ok, ResponseMessage = $"OTP verified successfully!" });; } else { return(new VerifyOTPResponse { Status = BusinessStatus.NotFound, ResponseMessage = $"Invalid OTP" });; } }
public IActionResult VerifyingOTP(VerifyOTP verifyOTP) { var response = _userService.VerifyingOTP(verifyOTP, Context); return(ServiceResponse(response)); //switch (response.Status) //{ // case BusinessStatus.NotFound: // return Ok(response); // case BusinessStatus.Ok: // return Ok(response); // default: // return Forbid(); //} }
public VerifyOTPResponse VerifyingOTP(VerifyOTP onetp, ApiContext apiContext) { return(_userproductService(apiContext.ProductType).VerifyingOTP(onetp, apiContext)); }
public VerifyOTPResponse VerifyingOTP(VerifyOTP onetp, ApiContext apiContext) { throw new NotImplementedException(); }