diff --git a/lib/omniauth/strategies/remote_user.rb b/lib/omniauth/strategies/remote_user.rb index d4eca87..6696613 100644 --- a/lib/omniauth/strategies/remote_user.rb +++ b/lib/omniauth/strategies/remote_user.rb @@ -41,17 +41,22 @@ module OmniAuth request.cookies.has_key?(options.last_path_cookie) && request.cookies[options.last_path_cookie] end + def __request_path(env) + env['REQUEST_PATH'] + end + def __set_last_path(env,response) request = Rack::Request.new(env) if not __last_path(env) - response.set_cookie(options.last_path_cookie, {value: request.path_info , path: "#{request.script_name}", httponly: true}) + response.set_cookie(options.last_path_cookie, {value: __request_path(env) , path: "#{request.script_name}"}) end end def __return_last_path(env) request = Rack::Request.new(env) - response = redirect_if_not_logging_in(request, __last_path(env)) - if response && __last_path(env) + if ! [_auth_path(request),_callback_path(request)].include?(__request_path(env)) && __last_path(env) + response = Rack::Response.new + response.redirect __last_path(env) response.delete_cookie(options.last_path_cookie , path: "#{request.script_name}" ) response.finish end -- libgit2 0.21.2