mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Restore full functionality of OAuth2 server [skip ci]
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
@@ -22,8 +24,9 @@ use yii\db\ActiveRecord;
|
||||
* @property int $created_at
|
||||
*
|
||||
* Behaviors:
|
||||
* @property Account|null $account
|
||||
* @property Account|null $account
|
||||
* @property OauthSession[] $sessions
|
||||
* @property-read OauthRefreshToken[] $refreshTokens
|
||||
*/
|
||||
class OauthClient extends ActiveRecord {
|
||||
|
||||
@@ -31,7 +34,7 @@ class OauthClient extends ActiveRecord {
|
||||
public const TYPE_MINECRAFT_SERVER = 'minecraft-server';
|
||||
|
||||
public static function tableName(): string {
|
||||
return '{{%oauth_clients}}';
|
||||
return 'oauth_clients';
|
||||
}
|
||||
|
||||
public function behaviors(): array {
|
||||
@@ -55,6 +58,10 @@ class OauthClient extends ActiveRecord {
|
||||
return $this->hasMany(OauthSession::class, ['client_id' => 'id']);
|
||||
}
|
||||
|
||||
public function getRefreshTokens(): ActiveQuery {
|
||||
return $this->hasMany(OauthRefreshToken::class, ['client_id' => 'id']);
|
||||
}
|
||||
|
||||
public static function find(): OauthClientQuery {
|
||||
return Yii::createObject(OauthClientQuery::class, [static::class]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user