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
3b8b38fb
Commit
3b8b38fb
authored
Jul 02, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If `omniauth_auto_sign_in_with_provider` is set,
it also means we're using omniauth, so we need to set it up.
parent
17a38b5a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
config/initializers/devise.rb
config/initializers/devise.rb
+1
-1
config/initializers/omniauth.rb
config/initializers/omniauth.rb
+1
-1
lib/gitlab/omniauth_initializer.rb
lib/gitlab/omniauth_initializer.rb
+5
-0
No files found.
config/initializers/devise.rb
View file @
3b8b38fb
...
...
@@ -219,7 +219,7 @@ Devise.setup do |config|
end
end
if
Gitlab
.
config
.
omniauth
.
enabled
if
Gitlab
::
OmniauthInitializer
.
enabled?
Gitlab
::
OmniauthInitializer
.
new
(
config
).
execute
(
Gitlab
.
config
.
omniauth
.
providers
)
end
end
config/initializers/omniauth.rb
View file @
3b8b38fb
...
...
@@ -17,7 +17,7 @@ OmniAuth.config.before_request_phase do |env|
Gitlab
::
RequestForgeryProtection
.
call
(
env
)
end
if
Gitlab
.
config
.
omniauth
.
enabled
if
Gitlab
::
OmniauthInitializer
.
enabled?
provider_names
=
Gitlab
.
config
.
omniauth
.
providers
.
map
(
&
:name
)
Gitlab
::
Auth
.
omniauth_setup_providers
(
provider_names
)
end
lib/gitlab/omniauth_initializer.rb
View file @
3b8b38fb
module
Gitlab
class
OmniauthInitializer
def
self
.
enabled?
Gitlab
.
config
.
omniauth
.
enabled
||
Gitlab
.
config
.
omniauth
.
auto_sign_in_with_provider
.
present?
end
def
initialize
(
devise_config
)
@devise_config
=
devise_config
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