From f1ecb8a2a88a9612aea1d19dfad6d2a421805453 Mon Sep 17 00:00:00 2001 From: Meghdad Date: Thu, 17 Jul 2025 17:00:46 +0330 Subject: [PATCH] fix app namespace and update comments --- README.md | 17 +++++++++++++---- composer.json | 1 + dabestaniha-authenticate-bridge.php | 1 - src/app/Http/Requests/BaseFormRequest.php | 2 +- src/{ => app}/Support/Collection.php | 2 +- vendor/composer/autoload_psr4.php | 1 + vendor/composer/autoload_static.php | 5 +++++ vendor/composer/installed.php | 4 ++-- 8 files changed, 24 insertions(+), 9 deletions(-) rename src/{ => app}/Support/Collection.php (85%) diff --git a/README.md b/README.md index 9ebbabf..eee3ba7 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,24 @@ Authenticate WordPress user via json web token from Laravel Application. ## Usage Send users to: -https://your-wp-site.com/dabestaniha/login?laravel_login_token=TOKEN +https://your-wp-site.com/dabestaniha/login/?token=TOKEN With required data encoded in the token. Payload JWT: ```json { - "email": "user@example.com", - "name": "Test User", - "exp": 1752575400 + "iat" : 1752671371, + "jti" : "---qwe---", + "iss" : "https://api.test", + "exp" : 1763039371, + "aud" : "https://api.test", + "data" : { + "id" : 1, + "name" : "Test User", + "mobile" : "9123456789", + "email" : "user@gmail.com", + "username" : "test-user" + } } ``` \ No newline at end of file diff --git a/composer.json b/composer.json index 48cdab4..2f1d7ab 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,7 @@ }, "autoload": { "psr-4": { + "Dabestaniha\\AuthenticateBridge\\App\\": "src/app/", "Dabestaniha\\AuthenticateBridge\\": "src/" }, "files": [ diff --git a/dabestaniha-authenticate-bridge.php b/dabestaniha-authenticate-bridge.php index 15716b5..41012d3 100644 --- a/dabestaniha-authenticate-bridge.php +++ b/dabestaniha-authenticate-bridge.php @@ -38,7 +38,6 @@ add_action('init', function () { require_once 'settings-page.php'; -// $jwt_secret = get_configured_option('jwt-secret'); function decrypt_jwt_token(string $token): array { $jwt_secret = get_configured_option('jwt-secret'); diff --git a/src/app/Http/Requests/BaseFormRequest.php b/src/app/Http/Requests/BaseFormRequest.php index 2ab51e1..60bbfb5 100644 --- a/src/app/Http/Requests/BaseFormRequest.php +++ b/src/app/Http/Requests/BaseFormRequest.php @@ -2,7 +2,7 @@ namespace Dabestaniha\AuthenticateBridge\App\Http\Requests; -use Dabestaniha\AuthenticateBridge\Support\Collection; +use Dabestaniha\AuthenticateBridge\App\Support\Collection; abstract class BaseFormRequest { diff --git a/src/Support/Collection.php b/src/app/Support/Collection.php similarity index 85% rename from src/Support/Collection.php rename to src/app/Support/Collection.php index efb4509..0d578ed 100644 --- a/src/Support/Collection.php +++ b/src/app/Support/Collection.php @@ -1,6 +1,6 @@ array($vendorDir . '/firebase/php-jwt/src'), + 'Dabestaniha\\AuthenticateBridge\\App\\' => array($baseDir . '/src/app'), 'Dabestaniha\\AuthenticateBridge\\' => array($baseDir . '/src'), ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a92d00a..6ea5de2 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -17,6 +17,7 @@ class ComposerStaticInit1e84672d5963a78cf9ba3e25dc66cf6f ), 'D' => array ( + 'Dabestaniha\\AuthenticateBridge\\App\\' => 35, 'Dabestaniha\\AuthenticateBridge\\' => 31, ), ); @@ -26,6 +27,10 @@ class ComposerStaticInit1e84672d5963a78cf9ba3e25dc66cf6f array ( 0 => __DIR__ . '/..' . '/firebase/php-jwt/src', ), + 'Dabestaniha\\AuthenticateBridge\\App\\' => + array ( + 0 => __DIR__ . '/../..' . '/src/app', + ), 'Dabestaniha\\AuthenticateBridge\\' => array ( 0 => __DIR__ . '/../..' . '/src', diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 043e631..67d136c 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'dabestaniha/authenticate-bridge', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'cb290223110f8d491dec9421621972ae82ef79df', + 'reference' => '89a7eed84730a7731c7c74cfba53878925b4ccbe', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'dabestaniha/authenticate-bridge' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => 'cb290223110f8d491dec9421621972ae82ef79df', + 'reference' => '89a7eed84730a7731c7c74cfba53878925b4ccbe', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),