mirror of
https://github.com/CyanoFresh/SmartHomePHP.git
synced 2026-03-07 02:16:50 +01:00
35
modules/api/Module.php
Normal file
35
modules/api/Module.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user