32 lines
1.0 KiB
PHP
32 lines
1.0 KiB
PHP
<?php
|
|
|
|
/**
|
|
* 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...
|
|
*/
|
|
|
|
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; |