mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Update Yii2 framework to the latest version
This commit is contained in:
@ -6,6 +6,7 @@ namespace api\modules\authserver;
|
||||
use Yii;
|
||||
use yii\base\BootstrapInterface;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\web\Response;
|
||||
|
||||
class Module extends \yii\base\Module implements BootstrapInterface {
|
||||
|
||||
@ -13,7 +14,7 @@ class Module extends \yii\base\Module implements BootstrapInterface {
|
||||
|
||||
public $defaultRoute = 'index';
|
||||
|
||||
public function beforeAction($action) {
|
||||
public function beforeAction($action): bool {
|
||||
if (!parent::beforeAction($action)) {
|
||||
return false;
|
||||
}
|
||||
@ -23,10 +24,18 @@ class Module extends \yii\base\Module implements BootstrapInterface {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function afterAction($action, $result) {
|
||||
if ($result === null) {
|
||||
Yii::$app->response->format = Response::FORMAT_RAW;
|
||||
}
|
||||
|
||||
return parent::afterAction($action, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \yii\base\Application $app
|
||||
*/
|
||||
public function bootstrap($app) {
|
||||
public function bootstrap($app): void {
|
||||
$legacyHost = $app->params['authserverHost'];
|
||||
$app->getUrlManager()->addRules([
|
||||
"//{$legacyHost}/authserver/auth/<action>" => "{$this->id}/authentication/<action>",
|
||||
|
Reference in New Issue
Block a user