public async Task <ActionResult> RemoveLogin(string loginProvider, string providerKey) { ManageMessageId?message; var result = await UserManageService.RemoveLoginAsync(User.Identity.GetUserId(), loginProvider, providerKey);//UserManager.RemoveLoginAsync(User.Identity.GetUserId(), new UserLoginInfo(loginProvider, providerKey)); if (result.Succeeded) { var user = await UserManageService.FindByIdAsync(User.Identity.GetUserId()); if (user != null) { await SignInManageService.SignInAsync(user, isPersistent : false, rememberBrowser : false); } message = ManageMessageId.RemoveLoginSuccess; } else { message = ManageMessageId.Error; } return(RedirectToAction("ManageLogins", new { Message = message })); }