title: Declaring custom failure action for warden not working
body: <p>Current in my warden manager we have a custom failure app declared.</p>
  
  <pre><code>    Rails.configuration.middleware.use Warden::Manager do |manager|
        manager.default_strategies :password
        manager.failure_app = lambda { |env| SessionsController.action(:new).call(env) }
      end
  </code></pre>
  
  <p>However, for one of my strategies I want to use a different failure action so I tried declaring a custom action in the failure as such:</p>
  
  <pre><code> def authenticate!
     email =  params["email"] || params['session']['email']
     pw =  params["password"] || params['session']['password']
     user = User.find_by_email email
     if user &amp;&amp; user.authenticate_and_activated(pw)
       success! user
     else
       throw(:warden, :stuff =&gt; "foo", :action =&gt; :failure)   
     end
   end
  </code></pre>
  
  <p>and even in my controller action:</p>
  
  <pre><code> def sign_in
     @user = warden.authenticate! :action =&gt; :failure
     ...
   end
  </code></pre>
  
  <p>and here is my failure action:</p>
  
  <pre><code>def failure        
    warden.custom_failure!
    render :json =&gt; {:success =&gt; false, :errors =&gt; ["Login Failed"]}
   end
  </code></pre>
  
  <p>But the issue is that it seems to be ignoring it and only calling the action declared in my manager. Anyone have an idea of what I could be doing wrong?</p>