public async Task<ActionResult> AddClaims(AddProfileClaimsViewModel viewModel) { var userId = ClaimsPrincipal.Current.Identity.GetUserId(); var user = await userManager.FindByIdAsync(userId); await userManager.AddClaimAsync(userId, new Claim(viewModel.ClaimType, viewModel.ClaimValue)); await userManager.SignInAsync(AuthenticationManager, user, true); return RedirectToAction("Index"); }
public async Task <ActionResult> AddClaims(AddProfileClaimsViewModel viewModel) { var userId = ClaimsPrincipal.Current.Identity.GetUserId(); var user = await userManager.FindByIdAsync(userId); await userManager.AddClaimAsync(userId, new Claim(viewModel.ClaimType, viewModel.ClaimValue)); await userManager.SignInAsync(AuthenticationManager, user, true); return(RedirectToAction("Index")); }