Implement Custom autoloader and JwtDecoder
This commit is contained in:
@@ -4,18 +4,29 @@
|
||||
* Plugin Name: Mahak Authenticate Bridge
|
||||
* Description: Authenticate WordPress user via json web token from Mahakiha Application.
|
||||
* Version: 1.0
|
||||
* Requires PHP: 8.0
|
||||
* Author: Dabestaniha
|
||||
*
|
||||
* Example: https://wordpress.test/mahak/login/?token=eyJ0...
|
||||
*/
|
||||
|
||||
require_once __DIR__.'/vendor/autoload.php';
|
||||
|
||||
use Dabestaniha\AuthenticateBridge\Autoloader;
|
||||
use Dabestaniha\AuthenticateBridge\App\Http\Controllers\AuthenticateController;
|
||||
use Dabestaniha\AuthenticateBridge\App\Http\Controllers\SettingsPageMenuController;
|
||||
use Dabestaniha\AuthenticateBridge\App\Http\Controllers\SettingsPageFormController;
|
||||
|
||||
require_once __DIR__.'/src/Autoloader.php';
|
||||
|
||||
Autoloader::register([
|
||||
'Dabestaniha\\AuthenticateBridge\\App\\' => __DIR__.'/src/app',
|
||||
'Dabestaniha\\AuthenticateBridge\\' => __DIR__.'/src',
|
||||
]);
|
||||
|
||||
require_once __DIR__.'/src/helpers.php';
|
||||
|
||||
add_action('init', fn() => AuthenticateController::resolve());
|
||||
|
||||
add_action('admin_menu', fn() => SettingsPageMenuController::resolve());
|
||||
add_action('admin_init', fn() => SettingsPageFormController::resolve());
|
||||
|
||||
echo true;
|
||||
Reference in New Issue
Block a user