mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Format
This commit is contained in:
@@ -329,7 +329,8 @@ App::post('/v1/account')
|
||||
$limit = $project->getAttribute('auths', [])['limit'] ?? 0;
|
||||
|
||||
if ($limit !== 0) {
|
||||
$total = $useProjectDB(fn (Database $dbForProject) =>
|
||||
$total = $useProjectDB(
|
||||
fn (Database $dbForProject) =>
|
||||
$dbForProject->count('users', max: APP_LIMIT_USERS)
|
||||
);
|
||||
|
||||
@@ -342,7 +343,8 @@ App::post('/v1/account')
|
||||
}
|
||||
|
||||
// Makes sure this email is not already used in another identity
|
||||
$identityWithMatchingEmail = $useProjectDB(fn (Database $dbForProject) =>
|
||||
$identityWithMatchingEmail = $useProjectDB(
|
||||
fn (Database $dbForProject) =>
|
||||
$dbForProject->findOne('identities', [
|
||||
Query::equal('providerEmail', [$email]),
|
||||
])
|
||||
@@ -391,11 +393,13 @@ App::post('/v1/account')
|
||||
'accessedAt' => DateTime::now(),
|
||||
]);
|
||||
$user->removeAttribute('$internalId');
|
||||
$user = Authorization::skip(fn () => $useProjectDB(fn (Database $dbForProject) =>
|
||||
$user = Authorization::skip(fn () => $useProjectDB(
|
||||
fn (Database $dbForProject) =>
|
||||
$dbForProject->createDocument('users', $user)
|
||||
));
|
||||
try {
|
||||
$target = Authorization::skip(fn () => $useProjectDB(fn (Database $dbForProject) =>
|
||||
$target = Authorization::skip(fn () => $useProjectDB(
|
||||
fn (Database $dbForProject) =>
|
||||
$dbForProject->createDocument('targets', new Document([
|
||||
'$permissions' => [
|
||||
Permission::read(Role::user($user->getId())),
|
||||
@@ -418,7 +422,8 @@ App::post('/v1/account')
|
||||
}
|
||||
}
|
||||
|
||||
$useProjectDB(fn (Database $dbForProject) =>
|
||||
$useProjectDB(
|
||||
fn (Database $dbForProject) =>
|
||||
$dbForProject->purgeCachedDocument('users', $user->getId())
|
||||
);
|
||||
} catch (Duplicate) {
|
||||
|
||||
@@ -36,7 +36,6 @@ use Utopia\Database\Validator\Authorization;
|
||||
use Utopia\DSN\DSN;
|
||||
use Utopia\Locale\Locale;
|
||||
use Utopia\Logger\Log;
|
||||
use Utopia\Pools\Connection;
|
||||
use Utopia\Pools\Group;
|
||||
use Utopia\Queue\Publisher;
|
||||
use Utopia\Storage\Device;
|
||||
|
||||
Reference in New Issue
Block a user