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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
5db3468d
Commit
5db3468d
authored
10 years ago
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5957 from ninech/dont-depend-on-appid-and-appsecret
refactor omniauth configuration method
parents
5e004719
7863319b
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
config/initializers/devise.rb
config/initializers/devise.rb
+10
-4
No files found.
config/initializers/devise.rb
View file @
5db3468d
...
@@ -227,15 +227,21 @@ Devise.setup do |config|
...
@@ -227,15 +227,21 @@ Devise.setup do |config|
end
end
Gitlab
.
config
.
omniauth
.
providers
.
each
do
|
provider
|
Gitlab
.
config
.
omniauth
.
providers
.
each
do
|
provider
|
provider_arguments
=
[]
%w[app_id app_secret]
.
each
do
|
argument
|
provider_arguments
<<
provider
[
argument
]
if
provider
[
argument
]
end
case
provider
[
'args'
]
case
provider
[
'args'
]
when
Array
when
Array
# An Array from the configuration will be expanded.
# An Array from the configuration will be expanded.
config
.
omniauth
provider
[
'name'
].
to_sym
,
provider
[
'app_id'
],
provider
[
'app_secret'
],
*
provider
[
'args'
]
provider_arguments
.
concat
provider
[
'args'
]
when
Hash
when
Hash
# A Hash from the configuration will be passed as is.
# A Hash from the configuration will be passed as is.
config
.
omniauth
provider
[
'name'
].
to_sym
,
provider
[
'app_id'
],
provider
[
'app_secret'
],
provider
[
'args'
]
provider_arguments
<<
provider
[
'args'
]
else
config
.
omniauth
provider
[
'name'
].
to_sym
,
provider
[
'app_id'
],
provider
[
'app_secret'
]
end
end
config
.
omniauth
provider
[
'name'
].
to_sym
,
*
provider_arguments
end
end
end
end
This diff is collapsed.
Click to expand it.
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