You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In sessions.AuthenticateWithClaims you use mapstructure to decode the custom claims into the object.
The call you are using doesn't respect a type implementing the json.Unmarshaler interface. Ideally you would use the standard json library for this, but I understand that it's difficult to implement (may need to unmarshal twice or something). The alternative is to add a DecodeHook to your mapstructure config which handles types which implement json.Unmarshaler
The text was updated successfully, but these errors were encountered:
Hey! This is a great suggestion. I'm wondering if something simple like this would hypothetically work:
ifunmarshaler, ok:=claims.(json.Unmarshaler); ok {
// use unmarshaler to decode the custom claims
} else {
// existing unmarshal logic using mapstructure
}
In
sessions.AuthenticateWithClaims
you use mapstructure to decode the custom claims into the object.The call you are using doesn't respect a type implementing the
json.Unmarshaler
interface. Ideally you would use the standard json library for this, but I understand that it's difficult to implement (may need to unmarshal twice or something). The alternative is to add a DecodeHook to your mapstructure config which handles types which implementjson.Unmarshaler
The text was updated successfully, but these errors were encountered: