Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Remove superfluous user updating

Oliver Günther5c6ed4ee883c
diff --git a/modules/auth_saml/lib/open_project/auth_saml/engine.rb b/modules/auth_saml/lib/open_project/auth_saml/engine.rb
index 72f3f5b7d43..c7a2d4b1ba6 100644
--- a/modules/auth_saml/lib/open_project/auth_saml/engine.rb
+++ b/modules/auth_saml/lib/open_project/auth_saml/engine.rb
@@ -57,20 +57,6 @@ module OpenProject
auth_provider-saml.png
)
- config.after_initialize do
- # Automatically update the openproject user whenever their info change in the upstream identity provider
- OpenProject::OmniAuth::Authorization.after_login do |user, auth_hash, context|
- # see https://github.com/opf/openproject/blob/caa07c5dd470f82e1a76d2bd72d3d55b9d2b0b83/app/controllers/concerns/omniauth_login.rb#L148
- attributes = context.send(:omniauth_hash_to_user_attributes, auth_hash) || {}
- attributes = attributes.with_indifferent_access
-
- # Don't allow unsetting admin if user is already admin
- attributes.delete(:admin) if user.admin?
-
- user.update attributes
- end
- end
-
register_auth_providers do
strategy :saml do
OpenProject::AuthSaml.configuration.values.map do |h|