mirror of
https://github.com/elyby/accounts.git
synced 2026-05-04 21:21:20 +05:30
Implementation of the backend for the OAuth2 clients management
This commit is contained in:
@@ -4,6 +4,7 @@ namespace common\models;
|
||||
use common\components\Redis\Set;
|
||||
use Yii;
|
||||
use yii\base\NotSupportedException;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveQuery;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
@@ -14,6 +15,7 @@ use yii\db\ActiveRecord;
|
||||
* @property string|null $owner_id
|
||||
* @property string $client_id
|
||||
* @property string $client_redirect_uri
|
||||
* @property integer $created_at
|
||||
*
|
||||
* Отношения
|
||||
* @property OauthClient $client
|
||||
@@ -26,6 +28,15 @@ class OauthSession extends ActiveRecord {
|
||||
return '{{%oauth_sessions}}';
|
||||
}
|
||||
|
||||
public function behaviors() {
|
||||
return [
|
||||
[
|
||||
'class' => TimestampBehavior::class,
|
||||
'updatedAtAttribute' => false,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getClient(): ActiveQuery {
|
||||
return $this->hasOne(OauthClient::class, ['id' => 'client_id']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user