Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

An authentication package for the microphork framework.

Notifications You must be signed in to change notification settings

phork/microphork-package-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

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

About

An authentication package for the microphork framework.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages