Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
3d83181b
Commit
3d83181b
authored
Jul 27, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove GitLab custom fealure app for devise
parent
eaceee0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
29 deletions
+6
-29
config/initializers/devise.rb
config/initializers/devise.rb
+6
-6
lib/gitlab/devise_failure.rb
lib/gitlab/devise_failure.rb
+0
-23
No files found.
config/initializers/devise.rb
View file @
3d83181b
...
@@ -192,7 +192,7 @@ Devise.setup do |config|
...
@@ -192,7 +192,7 @@ Devise.setup do |config|
#
#
# The :"*/*" and "*/*" formats below is required to match Internet
# The :"*/*" and "*/*" formats below is required to match Internet
# Explorer requests.
# Explorer requests.
# config.navigational_formats = [:"*/*", "*/*", :html
]
config
.
navigational_formats
=
[
:"*/*"
,
"*/*"
,
:html
,
:zip
]
# The default HTTP method used to sign out a resource. Default is :delete.
# The default HTTP method used to sign out a resource. Default is :delete.
config
.
sign_out_via
=
:delete
config
.
sign_out_via
=
:delete
...
@@ -206,11 +206,11 @@ Devise.setup do |config|
...
@@ -206,11 +206,11 @@ Devise.setup do |config|
# If you want to use other strategies, that are not supported by Devise, or
# If you want to use other strategies, that are not supported by Devise, or
# change the failure app, you can configure them inside the config.warden block.
# change the failure app, you can configure them inside the config.warden block.
#
#
config
.
warden
do
|
manager
|
#
config.warden do |manager|
manager
.
failure_app
=
Gitlab
::
DeviseFailure
#
manager.failure_app = Gitlab::DeviseFailure
#
manager.intercept_401 = false
#
manager.intercept_401 = false
#
manager.default_strategies(scope: :user).unshift :some_external_strategy
#
manager.default_strategies(scope: :user).unshift :some_external_strategy
end
#
end
if
Gitlab
::
LDAP
::
Config
.
enabled?
if
Gitlab
::
LDAP
::
Config
.
enabled?
Gitlab
::
LDAP
::
Config
.
providers
.
each
do
|
provider
|
Gitlab
::
LDAP
::
Config
.
providers
.
each
do
|
provider
|
...
...
lib/gitlab/devise_failure.rb
deleted
100644 → 0
View file @
eaceee0f
module
Gitlab
class
DeviseFailure
<
Devise
::
FailureApp
protected
# Override `Devise::FailureApp#request_format` to handle a special case
#
# This tells Devise to handle an unauthenticated `.zip` request as an HTML
# request (i.e., redirect to sign in).
#
# Otherwise, Devise would respond with a 401 Unauthorized with
# `Content-Type: application/zip` and a response body in plaintext, and the
# browser would freak out.
#
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/12944
def
request_format
if
request
.
format
==
:zip
Mime
::
Type
.
lookup_by_extension
(
:html
).
ref
else
super
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment