Monkey patches for authlogic to work with mongomapper and vice versa
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
README.rdoc
init.rb

README.rdoc

Authlogic+MongoMapper monkey

This rails plugin is a set of patches both to authlogic and mongomapper to make them work together.

Part of these patches is jnunemaker-validatable fixes (required by authlogic)

Also this plugin tries to adapt authlogic_openid automatically (if found)

Install

Just do:

$ script/plugin install git://github.com/cail/authlogic_mongomapper_monkey.git

Usage

Draft and unstable! Use on your own risk.

Install and just follow authlogic guides for model and session definition.

Of course, model should be defined as a MongoMapper::Document, all the attributes required by authlogic should be defined in mongomapper style, like:

key :name, String
key :email, String
key :crypted_password, String
key :password_salt, String
key :persistence_token, String
key :single_access_token, String
key :perishable_token, String
key :login_count, Integer, :default => 0, :null => false
key :failed_login_count, Integer, :default => 0, :null => false
key :last_request_at, Time
key :current_login_at, Time
key :last_login_at, Time
key :current_login_ip, String
key :last_login_ip, String
# created_at, updated_at, helpers
timestamps!

Since authlogic depends on model attributes, only after above key definitions do

acts_as_authentic

and use any of authlogic configuration stuff

Resources

Project Site

Credits

Igor Russkih, released under the MIT license