debian-mirror-gitlab/lib/gitlab/devise_failure.rb

22 lines
492 B
Ruby
Raw Normal View History

2019-12-04 20:38:33 +05:30
# frozen_string_literal: true
module Gitlab
class DeviseFailure < Devise::FailureApp
2019-12-26 22:10:19 +05:30
include ::SessionsHelper
2019-12-04 20:38:33 +05:30
# If the request format is not known, send a redirect instead of a 401
# response, since this is the outcome we're most likely to want
def http_auth?
return super unless Feature.enabled?(:devise_redirect_unknown_formats, default_enabled: true)
request_format && super
end
2019-12-26 22:10:19 +05:30
def respond
limit_session_time
super
end
2019-12-04 20:38:33 +05:30
end
end