Browse Source

Merge pull request #46 from daveriess/master

Eliminates appended '?' to redirects that have no query string
master
Dmitrii Golub 10 years ago
parent
commit
9c71601f5f
  1. 2
      .gitignore
  2. 2
      lib/two_factor_authentication/controllers/helpers.rb

2
.gitignore vendored

@ -19,3 +19,5 @@ capybara-*.html
dump.rdb dump.rdb
*.ids *.ids
.rbenv-version .rbenv-version
.ruby-gemset
.ruby-version

2
lib/two_factor_authentication/controllers/helpers.rb

@ -21,7 +21,7 @@ module TwoFactorAuthentication
def handle_failed_second_factor(scope) def handle_failed_second_factor(scope)
if request.format.present? and request.format.html? 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) redirect_to two_factor_authentication_path_for(scope)
else else
render nothing: true, status: :unauthorized render nothing: true, status: :unauthorized

Loading…
Cancel
Save