Skip to content

Commit 41df224

Browse files
committed
fix api login issue
1 parent 7d3ec41 commit 41df224

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Service/Action/Extension/Auth/UserFormattingExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ protected function _userCleanup($user)
7979
->where([$this->getUsersTable()->aliasField('id') => $user['id']])
8080
->first();
8181

82+
if (empty($currentUser)) {
83+
return $user;
84+
}
85+
8286
$user = $currentUser->toArray();
8387
$user['api_token'] = $currentUser['api_token'];
8488

0 commit comments

Comments
 (0)