async public Task <bool> VerifyUser(string secret, VerificationType verificationType) { if (string.IsNullOrEmpty(secret)) { await InvalidSecretErrorAsync(verificationType); return(false); } if (verificationType == VerificationType.OTP) { var request = new VerifyOTPRequest(secret); try { await _apiService.PostAccountVerifyOTPAsync(request); } catch { await InvalidSecretErrorAsync(verificationType); return(false); } } else { var passwordValid = await _cryptoService.CompareAndUpdateKeyHashAsync(secret, null); if (!passwordValid) { await InvalidSecretErrorAsync(verificationType); return(false); } } return(true); }
public Task PostAccountVerifyOTPAsync(VerifyOTPRequest request) { return(SendAsync <VerifyOTPRequest, object>(HttpMethod.Post, "/accounts/verify-otp", request, true, false)); }