refactor: fix code smells

This commit is contained in:
Elias Schneider
2025-03-27 16:48:36 +01:00
parent 6fa26c97be
commit c9e0073b63
19 changed files with 191 additions and 200 deletions

View File

@@ -492,9 +492,8 @@ func (s *OidcService) GetUserClaimsForClient(userID string, clientID string) (ma
for _, customClaim := range customClaims {
// The value of the custom claim can be a JSON object or a string
var jsonValue interface{}
//nolint:errcheck // Ignore error for JSON unmarshalling
json.Unmarshal([]byte(customClaim.Value), &jsonValue)
if jsonValue != nil {
err := json.Unmarshal([]byte(customClaim.Value), &jsonValue)
if err == nil {
// It's JSON so we store it as an object
claims[customClaim.Key] = jsonValue
} else {