Skip to content

How do I set unregistered claims without using the deprecated unregisteredClaims or addClaim methods? #116

Description

@ChrisPenner

The previous way to handle unregistered claims was to use these methods:

image

Which have both been deprecated, stating to "use a sub-type", which I assume means to define an instance of HasClaimsSet for some type I define;
However, there doesn't appear to be any way to actually provide unregistered claims for a custom type, since there's no lens for unregistered claims in HasClaimsSet to implement in the instance, and there's no way to create a ClaimsSet record otherwise since the _unregisteredClaims field of ClaimsSet isn't exported.

I suppose I could use the FromJSON instance of ClaimsSet to implement HasClaimsSet without using any deprecated methods, but that definitely seems like taking the long-way around and would involve introducing a possible failure point in the decoding step.

Perhaps was an claimUnregistered :: Lens' a (Map Text Value) accidentally omitted from HasClaimsSet when the other methods were deprecated?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions