Because the library is in development mode if you want to install it add in your composer.json:
composer config minimum-stability dev
after composer request anwarqasem/ci_auth
Add in you .env
file:
#--------------------------------------------------------------------
# JWT Token
#--------------------------------------------------------------------
JWT_SECRET=<change:some_random_words_or_chars>
JWT_ISS=<change:Issuer>
JWT_AUD=<change:Audience>
JWT_SUB=<change:Subject>
JWT_EXP=<change:ExpirationTime>
JWD_EXP
in hours. Eg: JWT_EXP=5
Find $aliases
array and add 'is_logged_in' => AuthLibrary::class,
. On a new CI installation it should looks
something like this:
public $aliases = [
'csrf' => CSRF::class,
'toolbar' => DebugToolbar::class,
'honeypot' => Honeypot::class,
'is_logged_in' => AuthLibrary::class,
];
Find $globals
array and add 'is_logged_in' => [ 'except' => [ '/', 'auth/*' ] ],
. On a new CI installation it should looks
something like this:
public $globals = [
'before' => [
// 'honeypot',
// 'csrf',
'is_logged_in' => [
'except' => [
'/',
'auth/*'
]
]
],
'after' => [
// 'toolbar',
// 'honeypot',
],
];