Commit 1be777b155cde4b738dcd8ef77edc852eeecadb5
1 parent
528e677b
Exists in
master
and in
2 other branches
Fixed double redirect url
Showing
1 changed file
with
10 additions
and
10 deletions
Show diff stats
lib/omniauth/strategies/remote_user.rb
... | ... | @@ -2,7 +2,7 @@ module OmniAuth |
2 | 2 | module Strategies |
3 | 3 | class RemoteUser |
4 | 4 | include OmniAuth::Strategy |
5 | - | |
5 | + | |
6 | 6 | option :cookie, '_gitlab_session' |
7 | 7 | option :internal_cookie, '_remote_user' |
8 | 8 | |
... | ... | @@ -40,11 +40,10 @@ module OmniAuth |
40 | 40 | |
41 | 41 | def __logout(env) |
42 | 42 | request = Rack::Request.new(env) |
43 | - response = redirect_if_not_logging_in(request, request.path) | |
43 | + response = redirect_if_not_logging_in(request, sign_out_path ) | |
44 | 44 | if response |
45 | 45 | response.delete_cookie(options.cookie) |
46 | 46 | response.delete_cookie(options.internal_cookie) |
47 | - response.redirect sign_out_path | |
48 | 47 | response |
49 | 48 | end |
50 | 49 | end |
... | ... | @@ -65,8 +64,9 @@ module OmniAuth |
65 | 64 | |
66 | 65 | def redirect_if_not_logging_in(request, url) |
67 | 66 | if ! [ |
68 | - auth_path, | |
69 | - callback_path | |
67 | + sign_out_path, | |
68 | + auth_path, | |
69 | + callback_path | |
70 | 70 | ].include?(request.path_info) |
71 | 71 | response = Rack::Response.new |
72 | 72 | response.redirect url |
... | ... | @@ -94,17 +94,17 @@ module OmniAuth |
94 | 94 | end |
95 | 95 | |
96 | 96 | def callback_path |
97 | - "#{auth_path}/callback" | |
97 | + "#{auth_path}/callback" | |
98 | 98 | end |
99 | 99 | |
100 | 100 | def auth_path |
101 | - "#{path_prefix}/RemoteUser" | |
101 | + "#{path_prefix}/RemoteUser" | |
102 | 102 | end |
103 | - | |
103 | + | |
104 | 104 | def sign_out_path |
105 | - '/users/sign_out' | |
105 | + '/users/sign_out' | |
106 | 106 | end |
107 | - | |
107 | + | |
108 | 108 | end |
109 | 109 | end |
110 | 110 | end | ... | ... |