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,6 +47,8 @@ class BitinflowAccountsSsoUserProvider implements UserProvider
->where($model->getAuthIdentifierName(), $identifier)
->first();
// Return user when found
if ($user) {
// Update access token when updated
if ($this->accessTokenField) {
$user[$this->accessTokenField] = $token;
@@ -56,12 +58,11 @@ class BitinflowAccountsSsoUserProvider implements UserProvider
}
}
if ($user) {
return $user;
}
// Create new user
$this->bitinflowAccounts->setToken($token);
$result = $this->bitinflowAccounts->getAuthedUser();
if (!$result->success()) {