Class Warden::Manager
In: lib/warden/manager.rb
Parent: Object

The middleware for Rack Authentication The middlware requires that there is a session upstream The middleware injects an authentication object into the rack environment hash

Methods

Attributes

config  [RW] 

Public Class methods

Initialize the middleware. If a block is given, a Warden::Config is yielded so you can properly configure the Warden::Manager. :api: public

Reconstitues the user from the session. Use the results of user_session_key to reconstitue the user from the session on requests after the initial login

Example:

  Warden::Manager.serialize_from_session{ |id| User.get(id) }

:api: public

Prepares the user to serialize into the session. Any object that can be serialized into the session in some way can be used as a "user" object Generally however complex object should not be stored in the session. If possible store only a "key" of the user object that will allow you to reconstitute it.

Example:

  Warden::Manager.serialize_into_session{ |user| user.id }

:api: public

[Validate]