private async void CheckAuthCode(string authenticationCode) { try { using var client = await DataReceiveHelper.NewClientAsync(); await client.ExecuteAsync(new TdApi.CheckAuthenticationCode { Code = authenticationCode }); } catch (TdException e) { var error = e.Error; ViewData["ErrorMessage"] = error.Message; } }
public async Task <IActionResult> SendAuthCode() { try { using var client = await DataReceiveHelper.NewClientAsync(); await client.ExecuteAsync(new TdApi.SetAuthenticationPhoneNumber { PhoneNumber = PhoneNumber }); } catch (TdException e) { var error = e.Error; ViewData["ErrorMessage"] = error.Message; } return(RedirectToAction(nameof(Index))); }