microphork/package-auth

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (dev-master) of this package.

An authentication package for the microphork framework

Installs: 282

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:microphork-package

dev-master 2019-03-14 01:07 UTC

This package is not auto-updated.

Last update: 2021-12-06 00:42:38 UTC


README

This is an authentication package for the microphork framework. The authentication class is a dispatcher. Currently the only available handler spoofs the user data.

To extend this package create a \Phork\App\Auth class in the app/classes folder and an app/config/auth.php file to define the active handler.

Usage

//load and initialize a new auth package
$class = \Phork::instance()->initPackage('Auth');
$auth = new $class();

//get the loaded config
$config = \Phork::config()->get('auth');

//initialize the auth handler
if ($config->handlers && $handlers = $config->handlers->export()) {
    $auth->init($handlers);
}

//show the user data
\Phork::output()
    ->addContent('authenticated: '.$auth->isAuthenticated().'<br />')
    ->addContent('user id: '.$auth->getUserId().'<br />')
    ->addContent('user name: '.$auth->getUserName().'<br />')
;

Credits

Built by Elenor at Phork Labs.

License

Licensed under The MIT License http://www.opensource.org/licenses/mit-license.php