do not set nil to Locale field

This commit is contained in:
Tim Möhlmann 2023-12-22 10:35:03 +02:00
parent bc1fbf5eaa
commit ca83a6032a
2 changed files with 6 additions and 7 deletions

View file

@ -41,13 +41,7 @@ func (u *UserInfo) MarshalJSON() ([]byte, error) {
}
func (u *UserInfo) UnmarshalJSON(data []byte) error {
if err := unmarshalJSONMulti(data, (*uiAlias)(u), &u.Claims); err != nil {
return err
}
if u.Locale != nil && u.Locale.tag.IsRoot() {
u.Locale = nil
}
return nil
return unmarshalJSONMulti(data, (*uiAlias)(u), &u.Claims)
}
type UserInfoProfile struct {