Skip to content

Commit

Permalink
replace request.path + '?' + request.query_string with request.origin…
Browse files Browse the repository at this point in the history
…al_fullpath in order to avoid appending '?' to redirects that have no query string
  • Loading branch information
daveriess committed Dec 27, 2014
1 parent f3d7612 commit 10e0ebb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/two_factor_authentication/controllers/helpers.rb
Expand Up @@ -21,7 +21,7 @@ def handle_two_factor_authentication

def handle_failed_second_factor(scope)
if request.format.present? and request.format.html?
session["#{scope}_return_to"] = "#{request.path}?#{request.query_string}" if request.get?
session["#{scope}_return_to"] = request.original_fullpath if request.get?
redirect_to two_factor_authentication_path_for(scope)
else
render nothing: true, status: :unauthorized
Expand Down

0 comments on commit 10e0ebb

Please sign in to comment.