redirect_back.rb

Path: lib/merb-auth-more/mixins/redirect_back.rb
Last Update: Wed Jul 08 12:17:34 -0600 2009

Impelments redirect_back_or. i.e. remembers where you‘ve come from on a failed login and stores this inforamtion in the session. When you‘re finally logged in you can use the redirect_back_or helper to redirect them either back where they came from, or a pre-defined url.

Here‘s some examples:

 1. User visits login form and is logged in
    - redirect to the provided (default) url

 2. User vists a page (/page) and gets kicked to login (raised Unauthenticated)
    - On successful login, the user may be redirect_back_or("/home") and they will
      return to the /page url.  The /home  url is ignored

Included Modules

Merb::Authentication::Mixins::RedirectBack

[Validate]