mirror of
https://github.com/elyby/accounts.git
synced 2024-12-02 19:50:46 +05:30
35 lines
964 B
PHP
35 lines
964 B
PHP
|
<?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);
|
||
|
}
|
||
|
|
||
|
}
|