Skip to content

Commit 5ca30d3

Browse files
committed
(fix): tolerate console signup restriction in installer account creation
1 parent 7668487 commit 5ca30d3

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/Appwrite/Platform/Tasks/Install.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,9 @@ private function createInitialAdminAccount(array $account, ?callable $progress,
658658
messageOverride: 'Creating Appwrite account'
659659
);
660660

661-
// Create the account — tolerate "already exists" so we can still
662-
// create a session (common when re-running the installer).
661+
// Create the account — tolerate "already exists" and "console
662+
// is restricted" errors so we can still create a session
663+
// (common when re-running the installer or upgrading).
663664
$userId = null;
664665
try {
665666
$userId = $this->makeApiCall('/v1/account', [
@@ -669,7 +670,10 @@ private function createInitialAdminAccount(array $account, ?callable $progress,
669670
'name' => $name
670671
], false, $apiUrl, $domain);
671672
} catch (\Throwable $e) {
672-
if (\stripos($e->getMessage(), 'already exists') === false) {
673+
$message = $e->getMessage();
674+
$accountExists = \stripos($message, 'already exists') !== false
675+
|| \stripos($message, 'console is restricted') !== false;
676+
if (!$accountExists) {
673677
throw $e;
674678
}
675679
}

0 commit comments

Comments
 (0)