Skip to content

Commit a0cbfde

Browse files
committed
Fixing redirect
1 parent 90fdee9 commit a0cbfde

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/travis/api/app/endpoint/authorization.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def handshake
167167
unless state_ok?(params[:state])
168168
log_with_request_id("[handshake] Handshake failed (state mismatch)")
169169
handle_invalid_response
170+
return
170171
end
171172

172173
endpoint.path = config[:access_token_path]
@@ -197,6 +198,7 @@ def vcs_handshake
197198
if params[:code]
198199
unless state_ok?(params[:state], params[:provider])
199200
handle_invalid_response
201+
return
200202
end
201203

202204
vcs_data = remote_vcs_user.authenticate(
@@ -269,7 +271,7 @@ def clear_state_cookies
269271
def handle_invalid_response
270272
clear_state_cookies
271273
back_url = headers['Referer'] || Travis.config.host
272-
response.redirect(back_url)
274+
redirect to(back_url)
273275
end
274276

275277
def create_state

0 commit comments

Comments
 (0)