mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Попытка реализовать отдельный компонент для oAuth авторизации в свой же API. Не тестировал, не проверял работу, просто пушнул, чтобы потом продолжить в дргуом месте.
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
namespace common\models;
|
||||
|
||||
use common\components\redis\Set;
|
||||
use Yii;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
/**
|
||||
@@ -13,6 +12,8 @@ use yii\db\ActiveRecord;
|
||||
* @property integer $expire_time
|
||||
*
|
||||
* @property Set $scopes
|
||||
*
|
||||
* @property OauthSession $session
|
||||
*/
|
||||
class OauthAccessToken extends ActiveRecord {
|
||||
|
||||
@@ -38,4 +39,8 @@ class OauthAccessToken extends ActiveRecord {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function isExpired() {
|
||||
return time() > $this->expire_time;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user