mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Реорганизована выдача JWT токенов
Добавлен механизм сохранения сессий и refresh_token
This commit is contained in:
@@ -14,7 +14,8 @@ trait AccountFinder {
|
||||
*/
|
||||
public function getAccount() {
|
||||
if ($this->account === null) {
|
||||
$this->account = Account::findOne([$this->getLoginAttribute() => $this->getLogin()]);
|
||||
$className = $this->getAccountClassName();
|
||||
$this->account = $className::findOne([$this->getLoginAttribute() => $this->getLogin()]);
|
||||
}
|
||||
|
||||
return $this->account;
|
||||
@@ -24,4 +25,11 @@ trait AccountFinder {
|
||||
return strpos($this->getLogin(), '@') ? 'email' : 'username';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Account|string
|
||||
*/
|
||||
protected function getAccountClassName() {
|
||||
return Account::class;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user