PHP code example of maaarghk / magento-jwt-refresh-service

1. Go to this page and download the library: Download maaarghk/magento-jwt-refresh-service library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

maaarghk / magento-jwt-refresh-service example snippets


class Whatever
{
    public function __construct(
        private \FTS\JwtRefreshService\Api\JwtRefreshServiceInterfaceFactory $jwtRefreshServiceFactory
    ) {}

    public function refreshToken(string $token)
    {
        $jwtRefreshService = $this->jwtRefreshServiceFactory->create([
            'token' => $token
        ]);
        return $jwtRefreshService->refreshAdminToken();
    }
}