OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/lib/open_project/authentication/failure_app.rb

23 lines
467 B

module OpenProject
module Authentication
class FailureApp
def call(env)
warden = env['warden']
if warden.present? && warden.result == :failure
wrong_credentials warden.message, headers: warden.headers
else
unauthorized
end
end
def wrong_credentials(message, headers: {})
[401, headers, [message]]
end
def unauthorized
[401, {}, []]
end
end
end
end