Skip to content

Guidecase/Authentication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Earlydoc Authorization

Usage

Active Model

Include the authentication concern in your model.

require 'earlydoc_auth'

class MyModel
  include MongoMapper::Document
  include ActiveModel::Authenticates
end

Action Pack (controller)

Include the authentication concerns in your controller(s).

class ApplicationController < ActionController::Base
  include ActionPack::EarlydocAuth::Authentication
  include ActionPack::EarlydocAuth::Cookies
end

To support progressive registration flows, the controller gains a current_authenticated_id(model) method that returns an object's id or alternatively the session id if no authenticated object is available:

session_or_user_id  = current_authenticated_id(User)
Tests

Run the gem test suite with rake test. Note, the dependency on MongoMapper means that a test database may be created on 127.0.0.1:27017 when testing persistent logic.

About

This gem provides active model helpers and Mongoid integration for authenticating users.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages