2024-09-25 14:17:36 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use kernel\App;
|
2024-10-17 16:47:04 +03:00
|
|
|
use kernel\CgRouteCollector;
|
2024-09-25 14:17:36 +03:00
|
|
|
use Phroute\Phroute\RouteCollector;
|
|
|
|
|
2024-10-17 14:55:00 +03:00
|
|
|
App::$collector->filter("auth", [\kernel\middlewares\AuthMiddleware::class, "handler"]);
|
2024-10-22 11:09:35 +03:00
|
|
|
App::$collector->filter('bearer', [\kernel\modules\secure\middlewares\BearerAuthMiddleware::class, "handler"]);
|
2024-09-25 14:17:36 +03:00
|
|
|
|
|
|
|
App::$collector->group(["prefix" => "admin"], function (RouteCollector $router){
|
|
|
|
App::$collector->group(["before" => "auth"], function (RouteCollector $router){
|
|
|
|
App::$collector->get('/', [\kernel\controllers\ModuleController::class, 'actionIndex']);
|
|
|
|
});
|
|
|
|
App::$collector->get('/login', [\kernel\modules\secure\controllers\SecureController::class, 'actionLogin']);
|
|
|
|
App::$collector->get('/logout', [\kernel\modules\secure\controllers\SecureController::class, 'actionLogout']);
|
|
|
|
App::$collector->post('/auth', [\kernel\modules\secure\controllers\SecureController::class, 'actionAuth']);
|
2024-12-05 14:31:04 +03:00
|
|
|
App::$collector->post('/email_auth', [\kernel\modules\secure\controllers\SecureController::class, 'actionEmailAuth']);
|
2024-12-04 12:42:53 +03:00
|
|
|
App::$collector->get('/register', [\kernel\modules\secure\controllers\SecureController::class, 'actionRegister']);
|
|
|
|
App::$collector->post('/registration', [\kernel\modules\secure\controllers\SecureController::class, 'actionRegistration']);
|
2024-12-05 14:31:04 +03:00
|
|
|
App::$collector->post('/code_check', [\kernel\modules\secure\controllers\SecureController::class, 'actionCodeCheck']);
|
2024-10-17 14:55:00 +03:00
|
|
|
});
|
|
|
|
|
2024-10-17 16:47:04 +03:00
|
|
|
App::$collector->group(["prefix" => "api"], function (CgRouteCollector $router){
|
2024-10-18 13:45:18 +03:00
|
|
|
App::$collector->group(["prefix" => "secure"], function (CgRouteCollector $router) {
|
2024-10-17 16:47:04 +03:00
|
|
|
App::$collector->post('/auth', [\kernel\modules\secure\controllers\SecureRestController::class, 'actionAuth']);
|
2024-12-09 13:46:10 +03:00
|
|
|
App::$collector->post('/email_auth', [\kernel\modules\secure\controllers\SecureRestController::class, 'actionEmailAuth']);
|
2024-12-09 14:45:44 +03:00
|
|
|
App::$collector->post('/code_check', [\kernel\modules\secure\controllers\SecureRestController::class, 'actionCodeCheck']);
|
2024-10-18 13:45:18 +03:00
|
|
|
});
|
2024-10-17 16:47:04 +03:00
|
|
|
});
|
|
|
|
|