fix: handle omitted role sync claim (#8697)

* fix: handle omitted role sync claim
This commit is contained in:
Steven Masley
2023-07-24 15:50:23 -04:00
committed by GitHub
parent ac973a4b2c
commit ac559f101e
2 changed files with 41 additions and 1 deletions

View File

@ -965,7 +965,8 @@ func (api *API) userOIDC(rw http.ResponseWriter, r *http.Request) {
// a member. This is because there is no way to tell the difference
// between []string{} and nil for OIDC claims. IDPs omit claims
// if they are empty ([]string{}).
rolesRow = []string{}
// Use []interface{}{} so the next typecast works.
rolesRow = []interface{}{}
}
rolesInterface, ok := rolesRow.([]interface{})