mirror of
https://github.com/CyanoFresh/SmartHomePHP.git
synced 2026-02-20 03:11:26 +01:00
36 lines
620 B
PHP
36 lines
620 B
PHP
<?php
|
|
|
|
namespace app\modules\api;
|
|
|
|
use yii\filters\auth\QueryParamAuth;
|
|
|
|
/**
|
|
* api module definition class
|
|
*/
|
|
class Module extends \yii\base\Module
|
|
{
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public $controllerNamespace = 'app\modules\api\controllers';
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function init()
|
|
{
|
|
parent::init();
|
|
|
|
\Yii::$app->user->enableSession = false;
|
|
}
|
|
|
|
public function behaviors()
|
|
{
|
|
$behaviors = parent::behaviors();
|
|
$behaviors['authenticator'] = [
|
|
'class' => QueryParamAuth::className(),
|
|
];
|
|
return $behaviors;
|
|
}
|
|
}
|