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

Fix auth source translation missing.

Dombi Attila512be0653450
diff --git a/app/contracts/users/base_contract.rb b/app/contracts/users/base_contract.rb
index a28ddcd0ec1..d2c36422b95 100644
--- a/app/contracts/users/base_contract.rb
+++ b/app/contracts/users/base_contract.rb
@@ -91,7 +91,7 @@ module Users
# rubocop:disable Rails/DynamicFindBy
def existing_auth_source
if ldap_auth_source_id && LdapAuthSource.find_by_unique(ldap_auth_source_id).nil?
- errors.add :auth_source, :error_not_found
+ errors.add :ldap_auth_source, :error_not_found
end
end
# rubocop:enable Rails/DynamicFindBy
diff --git a/app/models/user.rb b/app/models/user.rb
index 756c8231423..22e7c63f525 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -507,7 +507,7 @@ class User < Principal
# - OmniAuth
# - LDAP
def missing_authentication_method?
- identity_url.nil? && passwords.empty? && auth_source.nil?
+ identity_url.nil? && passwords.empty? && ldap_auth_source_id.nil?
end
# Returns the anonymous user. If the anonymous user does not exist, it is created. There can be only
diff --git a/spec/requests/api/v3/user/create_user_resource_spec.rb b/spec/requests/api/v3/user/create_user_resource_spec.rb
index a07fa09d021..272b606abf4 100644
--- a/spec/requests/api/v3/user/create_user_resource_spec.rb
+++ b/spec/requests/api/v3/user/create_user_resource_spec.rb
@@ -117,7 +117,7 @@ RSpec.describe API::V3::Users::UsersAPI do
expect(last_response.status).to eq(422)
expect(last_response.body)
- .to be_json_eql('authSource'.to_json)
+ .to be_json_eql('ldapAuthSource'.to_json)
.at_path('_embedded/details/attribute')
expect(last_response.body)