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
d7a3414a
Commit
d7a3414a
authored
Jun 08, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change GeoNode routes to use url_helpers
parent
c8d8000a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
app/models/geo_node.rb
app/models/geo_node.rb
+10
-4
config/routes.rb
config/routes.rb
+6
-4
No files found.
app/models/geo_node.rb
View file @
d7a3414a
...
...
@@ -66,13 +66,11 @@ class GeoNode < ActiveRecord::Base
end
def
oauth_callback_url
URI
.
join
(
uri
,
"
#{
uri
.
path
}
/"
,
'oauth/geo/callback'
).
to_s
Gitlab
::
Routing
.
url_helpers
.
oauth_geo_callback_url
(
url_helper_args
)
end
def
oauth_logout_url
(
state
)
logout_uri
=
URI
.
join
(
uri
,
"
#{
uri
.
path
}
/"
,
'oauth/geo/logout'
)
logout_uri
.
query
=
"state=
#{
state
}
"
logout_uri
.
to_s
Gitlab
::
Routing
.
url_helpers
.
oauth_geo_logout_url
(
url_helper_args
.
merge
(
state:
state
))
end
def
missing_oauth_application?
...
...
@@ -81,6 +79,14 @@ class GeoNode < ActiveRecord::Base
private
def
url_helper_args
if
relative_url_root
relative_url
=
relative_url_root
.
starts_with?
(
'/'
)
?
relative_url_root
:
"/
#{
relative_url_root
}
"
end
{
protocol:
schema
,
host:
host
,
port:
port
,
script_name:
relative_url
}
end
def
refresh_bulk_notify_worker_status
if
Gitlab
::
Geo
.
primary?
Gitlab
::
Geo
.
bulk_notify_job
.
try
(
:enable!
)
...
...
config/routes.rb
View file @
d7a3414a
...
...
@@ -53,10 +53,12 @@ Rails.application.routes.draw do
authorizations:
'oauth/authorizations'
end
namespace
:oauth
,
path:
'oauth/geo'
,
controller:
'geo_auth'
,
as:
'oauth_geo'
do
get
'auth'
get
'callback'
get
'logout'
namespace
:oauth
do
scope
path:
'geo'
,
controller: :geo_auth
,
as: :geo
do
get
'auth'
get
'callback'
get
'logout'
end
end
# Autocomplete
...
...
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