public async Task <ActionResult> verify([FromBody] TokenVerificationModel data) { var currentUser = await userManager.GetUserAsync(this.User); if (ModelState.IsValid) { TokenVerificationResult result; if (data.Token.Length > 4) { result = await authy.verifyTokenAsync(currentUser.AuthyId, data.Token); } else { result = await authy.verifyPhoneTokenAsync(currentUser.PhoneNumber, currentUser.CountryCode, data.Token); } logger.LogDebug(result.ToString()); if (result.Succeeded) { await addTokenVerificationClaim(currentUser); return(Ok(result)); } else { return(BadRequest(result)); } } else { return(BadRequest(ModelState)); } }