mirror of
https://github.com/bitinflow/accounts.git
synced 2026-03-17 23:45:52 +00:00
Update BitinflowAccountsSsoUserProvider.php
This commit is contained in:
@@ -41,17 +41,25 @@ class BitinflowAccountsSsoUserProvider implements UserProvider
|
|||||||
public function retrieveById($identifier)
|
public function retrieveById($identifier)
|
||||||
{
|
{
|
||||||
$model = $this->createModel();
|
$model = $this->createModel();
|
||||||
|
$token = $this->request->bearerToken();
|
||||||
|
|
||||||
$user = $this->newModelQuery($model)
|
$user = $this->newModelQuery($model)
|
||||||
->where($model->getAuthIdentifierName(), $identifier)
|
->where($model->getAuthIdentifierName(), $identifier)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
// Update access token when updated
|
||||||
|
if ($this->accessTokenField) {
|
||||||
|
$user[$this->accessTokenField] = $token;
|
||||||
|
|
||||||
|
if ($user->isDirty()) {
|
||||||
|
$user->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($user) {
|
if ($user) {
|
||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
$token = $this->request->bearerToken();
|
|
||||||
|
|
||||||
$this->bitinflowAccounts->setToken($token);
|
$this->bitinflowAccounts->setToken($token);
|
||||||
|
|
||||||
$result = $this->bitinflowAccounts->getAuthedUser();
|
$result = $this->bitinflowAccounts->getAuthedUser();
|
||||||
|
|||||||
Reference in New Issue
Block a user