public async Task <ActionResult> start([FromBody] PhoneVerificationRequestModel verificationRequest) { HttpContext.Session.Set <PhoneVerificationRequestModel>("phone_verification_request", verificationRequest); if (ModelState.IsValid) { string result; if (verificationRequest.via == Verification.SMS) { result = await authy.phoneVerificationRequestAsync( verificationRequest.CountryCode, verificationRequest.PhoneNumber ); } else { result = await authy.phoneVerificationCallRequestAsync( verificationRequest.CountryCode, verificationRequest.PhoneNumber ); } return(Ok(result)); } else { return(BadRequest(ModelState)); } }
public async Task <ActionResult> voice() { var currentUser = await userManager.GetUserAsync(this.User); var result = await authy.phoneVerificationCallRequestAsync( currentUser.CountryCode, currentUser.PhoneNumber ); return(Ok(result)); }