mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-14 07:27:39 +00:00
fix(oidc apps): correctly remove last additional origin, redirect uri and post logout redirect uri (#9209)
# Which Problems Are Solved
A customer reached out to support, that the (last) `additional origin`
could not be removed. While testing / implementation it was discovered,
that the same applied to `redirect_uris` and `post_logout_redirect_uris`
# How the Problems Are Solved
- Correctly set the corresponding array to empty in the event so it can
be differentiated to `null` / not set in case of no change.
# Additional Changes
Replaced `reflect.DeepEqual` with `slices.Equal`
# Additional Context
- Reported to support
(cherry picked from commit c9aa5db2a5
)
This commit is contained in:
@@ -284,6 +284,10 @@ func ChangeVersion(version domain.OIDCVersion) func(event *OIDCConfigChangedEven
|
||||
|
||||
func ChangeRedirectURIs(uris []string) func(event *OIDCConfigChangedEvent) {
|
||||
return func(e *OIDCConfigChangedEvent) {
|
||||
if uris == nil {
|
||||
// explicitly set them to empty so we can differentiate "not set" in the event in case of no changes
|
||||
uris = make([]string, 0)
|
||||
}
|
||||
e.RedirectUris = &uris
|
||||
}
|
||||
}
|
||||
@@ -314,6 +318,10 @@ func ChangeAuthMethodType(authMethodType domain.OIDCAuthMethodType) func(event *
|
||||
|
||||
func ChangePostLogoutRedirectURIs(logoutRedirects []string) func(event *OIDCConfigChangedEvent) {
|
||||
return func(e *OIDCConfigChangedEvent) {
|
||||
if logoutRedirects == nil {
|
||||
// explicitly set them to empty so we can differentiate "not set" in the event in case of no changes
|
||||
logoutRedirects = make([]string, 0)
|
||||
}
|
||||
e.PostLogoutRedirectUris = &logoutRedirects
|
||||
}
|
||||
}
|
||||
@@ -356,6 +364,10 @@ func ChangeClockSkew(clockSkew time.Duration) func(event *OIDCConfigChangedEvent
|
||||
|
||||
func ChangeAdditionalOrigins(additionalOrigins []string) func(event *OIDCConfigChangedEvent) {
|
||||
return func(e *OIDCConfigChangedEvent) {
|
||||
if additionalOrigins == nil {
|
||||
// explicitly set them to empty so we can differentiate "not set" in the event in case of no changes
|
||||
additionalOrigins = make([]string, 0)
|
||||
}
|
||||
e.AdditionalOrigins = &additionalOrigins
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user