lib/rails_warden.rb in rails_warden-0.2.4 vs lib/rails_warden.rb in rails_warden-0.2.5
- old
+ new
@@ -19,19 +19,27 @@
end
def raw_session
request.session
end
-
+
def reset_session!
raw_session.inspect # why do I have to inspect it to get it to clear?
raw_session.clear
end
end
Warden::Manager.before_failure do |env, opts|
env['warden'].request.params['action'] = RailsWarden.unauthenticated_action || "unauthenticated"
end
+
+# Rails needs the action to be passed in with the params
+Warden::Manager.before_failure do |env, opts|
+ if request = env["action_controller.rescue.request"]
+ request.params["action"] = RailsWarden.unauthenticated_action
+ end
+end
+
if defined?(Rails)
Rails.configuration.after_initialize do
class ActionController::Base
include RailsWarden::Mixins::HelperMethods