From f3d76128f787b4e31bfb437ed9c19228a3138fea Mon Sep 17 00:00:00 2001 From: Dave Riess Date: Sat, 27 Dec 2014 12:18:36 -0800 Subject: [PATCH 1/2] add RVM dot files to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ec16439..16f0a9f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ capybara-*.html dump.rdb *.ids .rbenv-version +.ruby-gemset +.ruby-version From 10e0ebbd9dfbd9436226330e0962a0d28dbf2237 Mon Sep 17 00:00:00 2001 From: Dave Riess Date: Sat, 27 Dec 2014 12:20:38 -0800 Subject: [PATCH 2/2] replace request.path + '?' + request.query_string with request.original_fullpath in order to avoid appending '?' to redirects that have no query string --- lib/two_factor_authentication/controllers/helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/two_factor_authentication/controllers/helpers.rb b/lib/two_factor_authentication/controllers/helpers.rb index a622dde..505ca01 100644 --- a/lib/two_factor_authentication/controllers/helpers.rb +++ b/lib/two_factor_authentication/controllers/helpers.rb @@ -21,7 +21,7 @@ module TwoFactorAuthentication 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