File: redirect_back.rb

# redirect_back.rb

Path: | lib/merb-auth-more/mixins/redirect_back.rb
Last Update: | Mon Mar 08 20:37:11 -0700 2010

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]