Remove refresh_token from OAuth2 result. Return the same access_token as a refresh_token in case when it's requested. Make access_tokens to live forever.

This commit is contained in:
ErickSkrauch
2019-12-09 19:31:54 +03:00
parent efb97a2006
commit ba7fad84a0
23 changed files with 231 additions and 297 deletions

View File

@@ -26,7 +26,6 @@ use yii\db\ActiveRecord;
* Behaviors:
* @property Account|null $account
* @property OauthSession[] $sessions
* @property-read OauthRefreshToken[] $refreshTokens
*/
class OauthClient extends ActiveRecord {
@@ -58,10 +57,6 @@ 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]);
}