示例#1
0
        public async Task <IActionResult> RemovePhoneNumber()
        {
            var user = await GetCurrentUserAsync();

            if (user != null)
            {
                var result = await _userManager.SetPhoneNumberAsync(user, null);

                if (result.Succeeded)
                {
                    await _signInManager.SignInAsync(user, isPersistent : false);

                    return(RedirectToAction(nameof(Index), new { Message = ManageMessageId.RemovePhoneSuccess }));
                }
            }
            return(RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }));
        }