mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Первичное портирование логики сервера авторизации с PhalconPHP на Yii2
This commit is contained in:
34
api/modules/authserver/Module.php
Normal file
34
api/modules/authserver/Module.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
namespace api\modules\authserver;
|
||||
|
||||
use yii\base\BootstrapInterface;
|
||||
use yii\base\InvalidConfigException;
|
||||
|
||||
class Module extends \yii\base\Module implements BootstrapInterface {
|
||||
|
||||
public $id = 'authserver';
|
||||
|
||||
public $defaultRoute = 'index';
|
||||
|
||||
/**
|
||||
* @var string базовый домен, запросы на который этот модуль должен обрабатывать
|
||||
*/
|
||||
public $baseDomain = 'https://authserver.ely.by';
|
||||
|
||||
public function init() {
|
||||
parent::init();
|
||||
if ($this->baseDomain === null) {
|
||||
throw new InvalidConfigException('base domain must be specified');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \yii\base\Application $app the application currently running
|
||||
*/
|
||||
public function bootstrap($app) {
|
||||
$app->getUrlManager()->addRules([
|
||||
$this->baseDomain . '/' . $this->id . '/auth/<action>' => $this->id . '/authentication/<action>',
|
||||
], false);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user