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

Ensure that only non-nil values are passed from registration form

Oliver Günther14b8e3fa35a3
diff --git a/app/services/authentication/omniauth_service.rb b/app/services/authentication/omniauth_service.rb
index 7e8e3dc2460..725cb3a4bcc 100644
--- a/app/services/authentication/omniauth_service.rb
+++ b/app/services/authentication/omniauth_service.rb
@@ -33,7 +33,7 @@ module Authentication
include Contracted
attr_accessor :auth_hash,
- :strategy,
+ :strategy,
:session,
:contract,
:user_attributes,
@@ -58,7 +58,9 @@ module Authentication
end
# Create or update the user from omniauth
- update_user_from_omniauth!(additional_user_params || {})
+ # and assign non-nil parameters from the registration form - if any
+ assignable_params = (additional_user_params || {}).reject { |_, v| v.nil? }
+ update_user_from_omniauth!(assignable_params)
# If we have a new or invited user, we still need to register them
activation_call = activate_user!