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
754bb9ac
Commit
754bb9ac
authored
Jan 20, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix logout on Gitlab Geo node
parent
6f546738
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+5
-1
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
+4
-4
app/models/geo_node.rb
app/models/geo_node.rb
+4
-0
No files found.
app/controllers/application_controller.rb
View file @
754bb9ac
...
...
@@ -93,7 +93,11 @@ class ApplicationController < ActionController::Base
end
def
after_sign_out_path_for
(
resource
)
current_application_settings
.
after_sign_out_path
||
new_user_session_path
if
Gitlab
::
Geo
.
readonly?
Gitlab
::
Geo
.
primary_node
.
url
else
current_application_settings
.
after_sign_out_path
||
new_user_session_path
end
end
def
abilities
...
...
app/controllers/sessions_controller.rb
View file @
754bb9ac
...
...
@@ -4,7 +4,7 @@ class SessionsController < Devise::SessionsController
prepend_before_action
:authenticate_with_two_factor
,
only:
[
:create
]
prepend_before_action
:store_redirect_path
,
only:
[
:new
]
before_action
:gitlab_geo_
auth
,
only:
[
:new
]
before_action
:gitlab_geo_
login
,
only:
[
:new
]
before_action
:auto_sign_in_with_provider
,
only:
[
:new
]
before_action
:load_recaptcha
...
...
@@ -57,7 +57,7 @@ class SessionsController < Devise::SessionsController
if
redirect_uri
.
path
==
new_user_session_path
redirect_to
=
root_url
elsif
Gitlab
::
Geo
.
geo_node?
(
host:
redirect_uri
.
host
,
port:
redirect_uri
.
port
)
redirect_to
=
redirect_ur
l
.
to_s
redirect_to
=
redirect_ur
i
.
to_s
end
@redirect_to
=
redirect_to
...
...
@@ -86,12 +86,12 @@ class SessionsController < Devise::SessionsController
end
end
def
gitlab_geo_
auth
def
gitlab_geo_
login
if
!
signed_in?
&&
Gitlab
::
Geo
.
enabled?
&&
Gitlab
::
Geo
.
readonly?
# share full url with primary node by shared session
session
[
:geo_node_return_to
]
=
@redirect_to
login_uri
=
URI
.
join
(
Gitlab
::
Geo
.
primary_node
.
ur
i
,
new_session_path
(
:user
)).
to_s
login_uri
=
URI
.
join
(
Gitlab
::
Geo
.
primary_node
.
ur
l
,
new_session_path
(
:user
)).
to_s
redirect_to
login_uri
end
end
...
...
app/models/geo_node.rb
View file @
754bb9ac
...
...
@@ -23,4 +23,8 @@ class GeoNode < ActiveRecord::Base
def
uri
URI
.
parse
(
"
#{
schema
}
://
#{
host
}
:
#{
port
}
/
#{
relative_url_root
}
"
)
end
def
url
uri
.
to_s
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