Change external auth providers to always reload on settings change

This commit is contained in:
Tomaž Jerman
2023-11-09 15:58:58 +01:00
parent 5ff29b7def
commit 0d999d1bba
+7 -4
View File
@@ -340,10 +340,13 @@ func (svc *service) UpdateSettings(s *settings.Settings) {
}
}
if len(svc.settings.Providers) != len(s.Providers) {
svc.log.Debug("setting changed", zap.Int("providers", len(s.Providers)))
external.SetupGothProviders(svc.log, svc.opt.ExternalRedirectURL, s.Providers...)
}
// Always reload external providers.
// This could be optionally skipped by strictly comparing if they actually changed.
// OIDC complicates it a bit wit all the mix and matching.
// Should be ok for now.
// @todo see if we can conditionally skip this
svc.log.Debug("setting changed", zap.Int("providers", len(s.Providers)))
external.SetupGothProviders(svc.log, svc.opt.ExternalRedirectURL, s.Providers...)
svc.settings = s
svc.handlers.Settings = s