Description
Not able to access UserClaims claims after they are set.
Upon trying to add a custom claim to the user JWT I was able to add items to claims as a serde_json::Value but when trying to read the claim in a middleware layer I wasn't able to access them because claims is private.
`
The expectation is that custom claims could be accessed after being set. Such that they can be accessed via UserClaims.claims or deconstructed in the scope of the project. I would suggest making claims public like pid.
Environment:
Additional Context
I am somewhat new, and this might be an oversight on my end. However, I don't believe that the claims:Option<serde_json> in UserClaims would serve any purpose internally besides allowing the developer to set custom claims in the JWT token.
Description Not able to access UserClaims claims after they are set.
Upon trying to add a custom claim to the user JWT I was able to add items to claims as a serde_json::Value but when trying to read the claim in a middleware layer I wasn't able to access them because claims is private. `
[derive(Debug, Serialize, Deserialize)]
pub struct UserClaims { pub pid: String, exp: usize, claims: Option,
}
`
Expected Behavior
The expectation is that custom claims could be accessed after being set. Such that they can be accessed via
UserClaims.claims
or deconstructed in the scope of the project. I would suggest making claims public like pid.Environment:
Additional Context
I am somewhat new, and this might be an oversight on my end. However, I don't believe that the
claims:Option<serde_json>
inUserClaims
would serve any purpose internally besides allowing the developer to set custom claims in the JWT token.