pails / auth
Installs: 398
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
pkg:composer/pails/auth
Requires
- pails/actionmailer: ^1.1
- pails/activerecord: ^1.2
- pails/pails: ^1.0
Suggests
- google/apiclient: Adds the ability to authenticate with Google
README
An authentication and authorization plugin for pails loosely based on UserPie (userpie.com). At this point it's a near-complete rewrite.
Dependencies
- pails
- pails/activerecord
- pails/actionmailer
We recommend using composer to get the dependencies. Furthermore, we recommend not installing the dependencies for pails-auth directly, but listing pails-auth as a dependency in your pails application's composer.json file.
Installation
In the root of a pails app, run
composer require pails/auth
Configuration
Inside any controller where you want to make use of the authentication/authorization
methods, use
the PailsAuthentication
trait.
class DefaultController extends Pails\Controller { use PailsAuthentication; }
You can then use the before actions require_login
or require_anonymous
:
$before_actions = array( 'require_login' => array('except' => array('index', 'about', 'contact')) );
Two utility methods, is_logged_in
and current_user
, are also provided.
Support
pails-auth is a core plugin maintained and supported by Brian Parks.