Disable BasicAuthFailure when basic auth config not enabled

pull/7451/head
Oliver Günther 5 years ago
parent 724f20b9eb
commit 0311ec1934
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 5
      lib/open_project/authentication/strategies/warden/basic_auth_failure.rb

@ -6,6 +6,11 @@ module OpenProject
# This strategy is inserted after optional basic auth strategies to
# indicate that invalid basic auth credentials were provided.
class BasicAuthFailure < ::Warden::Strategies::BasicAuth
def valid?
OpenProject::Configuration.apiv3_enable_basic_auth? && super
end
def authenticate_user(_username, _password)
nil # always fails
end

Loading…
Cancel
Save