StraightAuth
Installation
Add this line to your application's Gemfile:
gem 'straight_auth'
And then execute:
$ bundle
Usage
StraightAuth expects a User
model with the following instance methods:
id
password_digest=
and the following class methods:
- find_by_email(email)
- find(id)
You need to include StraightAuth::Model in your User
class, and call the provided
encrypt_password
when needed. Ie.
class User < ActiveRecord::Base
include StraightAuth::Model
before_save :encrypt_password
end
You also need to include StraightAuth::Helpers to your controllers, or, if you're
in a Sinatra environment, register StraightAuth
.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request