Update BitinflowAccountsSsoUserProvider.php

This commit is contained in:
2022-07-08 00:19:47 +02:00
committed by GitHub
parent a11436fbfe
commit 3c46197a61

View File

@@ -47,21 +47,22 @@ class BitinflowAccountsSsoUserProvider implements UserProvider
->where($model->getAuthIdentifierName(), $identifier) ->where($model->getAuthIdentifierName(), $identifier)
->first(); ->first();
// Update access token when updated // Return user when found
if ($this->accessTokenField) {
$user[$this->accessTokenField] = $token;
if ($user->isDirty()) {
$user->save();
}
}
if ($user) { if ($user) {
// Update access token when updated
if ($this->accessTokenField) {
$user[$this->accessTokenField] = $token;
if ($user->isDirty()) {
$user->save();
}
}
return $user; return $user;
} }
// Create new user
$this->bitinflowAccounts->setToken($token); $this->bitinflowAccounts->setToken($token);
$result = $this->bitinflowAccounts->getAuthedUser(); $result = $this->bitinflowAccounts->getAuthedUser();
if (!$result->success()) { if (!$result->success()) {