Files
SmartHomePHP/components/WebSocketAuth.php
Alex Solomaha 88ee886e69 Some work
2016-09-08 20:54:43 +03:00

24 lines
327 B
PHP

<?php
namespace app\components;
use app\models\User;
use Yii;
class WebSocketAuth
{
/**
* @return null|string
*/
public static function getAuthKey()
{
$user = User::findOne(Yii::$app->user->id);
if (!$user) {
return null;
}
return $user->auth_key;
}
}