Skip to content
An Easy Authentication Gem
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
.gitignore
Micah_NOTES
README.md
auth-easy.gemspec
auth_easy-0.0.1.pre.gem
auth_easy-0.0.2.pre.gem
auth_easy-0.0.3.pre.gem
auth_easy-0.0.4.pre.gem
auth_easy-0.0.5.pre.gem
auth_easy-0.0.6.pre.gem
auth_easy-0.0.7.pre.gem
auth_easy-0.0.8.pre.gem

README.md

Auth Easy

Auth Easy is a lightweight easy to use gem for basic email authentication. IT IS NOT CURRENTLY FINISHED AND HAS AT LEAST ONE SECURITY FLAW SO DO NOT USE FOR A PRODUCTION APP :) To use Auth-Easy in your applicaition follow these steps. Easy Peasy.

Auth-easy expects a users controller, a user model and a sessions controller. If these don't exist, make em. The user model should have at least a password_digest attribute and an email attribute.

First add the appropriate gems to your Gemfile

gem 'auth_easy', '~> 0.0.8.pre'

Then add these line to your routes file

  get 'login', :to => 'sessions#new'
  delete 'logout', :to => 'sessions#destroy'
  post '/sessions', :to => 'sessions#create'

Open your sessions controller, and do the following:

class SessionsController < ApplicationController

  include AuthEasy::SessionsActions

end

Similarly, open your users controller

class UsersController < ApplicationController

  include AuthEasy::RegistrationActions

end

And last, but not least, add the following to the User model.

class User < ActiveRecord::Base

  attr_accessible :email, :password
  has_secure_password

end

AuthEasy provides a number of useful view helpers for quickly building login and registration forms, confirming a user is logged in and finding the logged in user:

<%= simple_register_form %>
<%= simple_login_form %>
<%= simple_logout_link %>

<% logged_in? %>
<%= current_user %>

If you'd prefer to code your own form, then ensure your params hash includes this: {:user => {:email => "email", :password => "password"}}

Something went wrong with that request. Please try again.