Skip to content

Commit

Permalink
fix: don't update attribute mapping if nil (supabase#1665)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangmingtay authored and LashaJini committed Nov 13, 2024
1 parent 7275c8d commit d121d83
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions internal/api/ssoadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,13 @@ func (a *API) adminSSOProvidersUpdate(w http.ResponseWriter, r *http.Request) er
}
}

updateAttributeMapping := !provider.SAMLProvider.AttributeMapping.Equal(&params.AttributeMapping)
if updateAttributeMapping {
modified = true
provider.SAMLProvider.AttributeMapping = params.AttributeMapping
updateAttributeMapping := false
if params.AttributeMapping.Keys != nil {
updateAttributeMapping = !provider.SAMLProvider.AttributeMapping.Equal(&params.AttributeMapping)
if updateAttributeMapping {
modified = true
provider.SAMLProvider.AttributeMapping = params.AttributeMapping
}
}

nameIDFormat := ""
Expand Down

0 comments on commit d121d83

Please sign in to comment.