Exemplo n.º 1
0
        public async Task <IActionResult> SendChangeEmail(ChangeEmailCallbackViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("Index", profileViewModel));
            }

            var changeEmailTokenSent = await profileService.SendChangeEmailCallback(viewModel.NewEmail);

            return(changeEmailTokenSent
                ? (IActionResult)RedirectToAction("Index").PushAlert(changeEmailTokenSent ? $"Change email token was sent to: {viewModel.NewEmail}" : "Sending change email token failed")
                : View("Index", profileViewModel));
        }
Exemplo n.º 2
0
 public IViewComponentResult Invoke(ChangeEmailCallbackViewModel viewModel) => View(viewModel);