tumainimosha/token-helper

This package is abandoned and no longer maintained. No replacement package was suggested.

Your Package Description here

0.1.0 2019-08-07 17:07 UTC

This package is auto-updated.

Last update: 2023-10-06 19:28:15 UTC


README

Software License Travis Total Downloads

Install

composer require tumainimosha/token-helper

Usage

use Tumainimosha\TokenHelper\TokenHelper;

// Generating jwt token. jwt is base64 encoded string
$jwt_string = (new TokenHelper)->getToken([
        'terminal_id' => $terminal->id,
        'token_id' => $tokenModel->id,
    ], 60 * 24 * 365 * 5);

     
// validating jwt token
$helper = new TokenHelper;
$status = $helper->validateToken($jwt_string);

if ($status === $helper::OK) {
   //handle success case
}

elseif ($status === $helper::EXPIRED) {
    //handle success case
}

else {
    // handle invalid token
}

Testing

@TODO

vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email princeton.mosha@gmail.com instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.