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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request