NUBIC/aker — Issue #19: URL appends incorrectly if query param string already exists
Author: pfriedman
Created: 2012-01-31 18:56:27+00:00
State: open

lib/form/mode.rb

##
# Builds a Rack response that redirects to the login form.
#
# @return [Rack::Response]
def on_ui_failure
::Rack::Response.new do |resp|
target = login_url + '?url=' + escape(attempted_path)
if env['aker.session_expired']
target += '&session_expired=true'
end
resp.redirect(target)
end
end

builds a URL like this:
/accounts/login?m_id=1?url=%some_path%3Fm_id%3D1
if the original request is some_path?m_id=1