Ankush Verma

Ankush Verma

  • 1.9k
  • 87
  • 1.2k

Claim Value Updated in .net core

Jun 24 2021 5:34 PM

Hello I have Click a pay button then my table(Auth.AspNetUserClaims) is updated means value enter in table .But i have face a issue i have redirect other page not updated claims value . I want to redirect other page and get value upadated 

@model SubscriptionInfoModel
@using System.Security.Claims;
@inject SignInManager<PublisherFindersIdentityUser> SignInManager
@inject UserManager<PublisherFindersIdentityUser> UserManager
@{
ViewData["Title"] = "Subscriptions";
ViewData["ActivePage"] = ManageNavPages.SubscriptionInfo;
var PaymentAPIBaseURL = ViewData["PaymentAPIBaseUrl"];
var SubscriptionID = "";
var planStatus = "";
var UserId = this.User.FindFirstValue(ClaimTypes.NameIdentifier);
var Id = this.User.FindFirst(x => x.Type == "TrialStatus").Value;
if (User.Identity.IsAuthenticated)
{
ClaimsPrincipal cp = this.User;
var data = cp.Identities.ToList();
planStatus = data[0].FindFirst(c => c.Type == "TrialStatus").Value;
if (data[0].FindFirst(c => c.Type == "SubscriptionID") != null)
{
SubscriptionID = data[0].FindFirst(c => c.Type == "SubscriptionID").Value;
}
}

 


Answers (1)