Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
9f264578bf9b
Commit
e3670ac9
authored
Jul 02, 2018
by
Lin Jen-Shin
Browse files
If `omniauth_auto_sign_in_with_provider` is set,
it also means we're using omniauth, so we need to set it up.
parent
23a770a69199
Changes
3
Hide whitespace changes
Inline
Side-by-side
config/initializers/devise.rb
View file @
9f264578
...
...
@@ -219,7 +219,7 @@
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 @
9f264578
...
...
@@ -17,7 +17,7 @@ module OmniAuth::Strategies
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 @
9f264578
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