Skip to content

Commit

Permalink
fix unmarshal json issue when setting user
Browse files Browse the repository at this point in the history
Context: #79

When setting UserQuery params GetUsers throw an error Failed to get user: json: cannot unmarshal string into Go value of type []string
  • Loading branch information
melchiormoulin committed Apr 23, 2024
1 parent 61e6d58 commit 7995bb9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/onelogin/utilities/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ func queryToValues(query interface{}) (url.Values, error) {
if err != nil {
return nil, err
}
err = json.Unmarshal(queryBytes, &values)
if err != nil {
var data map[string]string
if err := json.Unmarshal(queryBytes, &data); err != nil {
return nil, err
}
for key, value := range data {
values.Set(key, value)
}
}

return values, nil
Expand Down

0 comments on commit 7995bb9

Please sign in to comment.