Szymon Nowak
2011-Mar-28 19:46 UTC
Strange issue with Rails middleware, Warden and missing path paremeters
Hey, this started as OmniAuth issue and is pretty well document here: https://github.com/intridea/omniauth/issues/#issue/239/comment/917065 If you have a bare Rails app with Devise gem (Warden itself would probably be enough), add the following middleware to simulate OmniAuth behavior: class BreakApp def initialize(app) @app = app end def call(env) @app.call(env.dup) # call 1 @app.call(env) # call 2 end end and call Warden in ApplicationController before_filter e.g.: request.env[''warden''].authenticate(:scope => :user) then params[:controller] and params[:action] are missing. If you remove the before filter *or* change the first call in the middleware to @app.call(env) (without #dup) it works fine. I prepared a sample app to show this issue: https://github.com/szimek/omniauth_dynamic_providers_bug I have no idea if this issue is caused by Rails or Warden code. Any ideas why path parameters are missing and how to fix it are welcome :) Cheers, Szymon -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.