Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-16 15:06:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-16 15:06:26 +0300
commitd2798d607e11e0ebae83ae909404834388733428 (patch)
tree096b7f4d4bdb315d28cdcd4d6db4e80911112e9c /lib/gitlab/devise_failure.rb
parentd8211a0ed119eada7d292e974a8fc7b0cd982d3c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/devise_failure.rb')
-rw-r--r--lib/gitlab/devise_failure.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/devise_failure.rb b/lib/gitlab/devise_failure.rb
new file mode 100644
index 00000000000..4d27b706e1e
--- /dev/null
+++ b/lib/gitlab/devise_failure.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module Gitlab
+ class DeviseFailure < Devise::FailureApp
+ # 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
+ end
+end