Merge pull request #7625 from appwrite/provider-null

Provider null
This commit is contained in:
Jake Barnby 2024-02-24 01:17:58 +13:00 committed by GitHub
commit 0d62ecf90f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -513,7 +513,7 @@ App::post('/v1/users/:userId/targets')
Permission::delete(Role::user($user->getId())),
],
'providerId' => $providerId ?? null,
'providerInternalId' => $provider->getInternalId() ?? null,
'providerInternalId' => $provider->isEmpty() ? null : $provider->getInternalId(),
'providerType' => $providerType,
'userId' => $userId,
'userInternalId' => $user->getInternalId(),
@ -1662,7 +1662,7 @@ App::post('/v1/users/:userId/sessions')
->inject('queueForEvents')
->action(function (string $userId, Request $request, Response $response, Database $dbForProject, Document $project, Locale $locale, Reader $geodb, Event $queueForEvents) {
$user = $dbForProject->getDocument('users', $userId);
if ($user === false || $user->isEmpty()) {
if ($user->isEmpty()) {
throw new Exception(Exception::USER_NOT_FOUND);
}
@ -1731,7 +1731,7 @@ App::post('/v1/users/:userId/tokens')
->action(function (string $userId, int $length, int $expire, Request $request, Response $response, Database $dbForProject, Event $queueForEvents) {
$user = $dbForProject->getDocument('users', $userId);
if ($user === false || $user->isEmpty()) {
if ($user->isEmpty()) {
throw new Exception(Exception::USER_NOT_FOUND);
}