acelan/simple-jwt

There is no license information available for the latest version (v1.0.2) of this package.

Json Web Token for PHP

v1.0.2 2021-04-27 12:02 UTC

This package is not auto-updated.

Last update: 2024-10-23 23:35:00 UTC


README

Json Web Token for PHP

Installation

composer require acelan/simple-jwt

Usage

use AceLan\JWT\JsonWebToken;

$payload = array('sub' => 'example@gmail.com', 'infoData' => ['name' => 'David']);

$token = JWTAuthLibrary::getToken($payload);

print_r($token);

$getPayload = JWTAuthLibrary::verifyToken($token['accessToken']);

$getRrfreshPayload = JWTAuthLibrary::verifyRefreshToken($token['accessToken'], $token['refreshToken']);

echo "<br>";
var_dump($getPayload);
echo "<br>";
var_dump($getRrfreshPayload);