fix: omit empty user info values

This commit is contained in:
Stavros
2026-03-02 16:00:24 +02:00
parent fcc56b2ce5
commit 34c035e855

View File

@@ -46,10 +46,10 @@ type ClaimSet struct {
Sub string `json:"sub"` Sub string `json:"sub"`
Iat int64 `json:"iat"` Iat int64 `json:"iat"`
Exp int64 `json:"exp"` Exp int64 `json:"exp"`
Name string `json:"name"` Name string `json:"name,omitempty"`
Email string `json:"email"` Email string `json:"email,omitempty"`
PreferredUsername string `json:"preferred_username"` PreferredUsername string `json:"preferred_username,omitempty"`
Groups []string `json:"groups"` Groups []string `json:"groups,omitempty"`
} }
type UserinfoResponse struct { type UserinfoResponse struct {
@@ -57,7 +57,7 @@ type UserinfoResponse struct {
Name string `json:"name"` Name string `json:"name"`
Email string `json:"email"` Email string `json:"email"`
PreferredUsername string `json:"preferred_username"` PreferredUsername string `json:"preferred_username"`
Groups []string `json:"groups"` Groups []string `json:"groups,omitempty"`
UpdatedAt int64 `json:"updated_at"` UpdatedAt int64 `json:"updated_at"`
} }