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");
        }
示例#2
0
        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"));
        }