def before_failure(options = {}, method = :push, &block)
      raise BlockNotGiven unless block_given?
      _before_failure.send(method, [block, options])
    end
def before_failure(options = {}, method = :push, &block)
      raise BlockNotGiven unless block_given?
      _before_failure.send(method, [block, options])
    end
A callback that runs just prior to the failure application being called.
 This callback occurs after PATH_INFO has been modified for the failure (default /unauthenticated)
 In this callback you can mutate the environment as required by the failure application
 If a Rails controller were used for the failure_app for example, you would need to set request[:params][:action] = :unauthenticated

 Parameters:
 <options> Some options which specify when the callback should be executed
   scope  - Executes the callback only if it matches the scope(s) given
 <block> A block to contain logic for the callback
   Block Parameters: |env, opts|
     env - The rack env hash
     opts - any options passed into the authenticate call including :scope

 Example:
   Warden::Manager.before_failure do |env, opts|
     params = Rack::Request.new(env).params
     params[:action] = :unauthenticated
     params[:warden_failure] = opts
   end

 :api: public