diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 88c1b18a3c..8eb6be6390 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -56,9 +56,9 @@ App::post('/v1/account') ->label('sdk.response.model', Response::MODEL_ACCOUNT) ->label('abuse-limit', 10) ->param('userId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.') - ->param('email', '', new Email(), 'User email.', true) + ->param('email', null, new Email(), 'User email.', true) ->param('password', '', new Password(), 'User password. Must be at least 8 chars.', true) - ->param('phone', '', new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) + ->param('phone', null, new Phone(), 'Phone number. Format this number with a leading \'+\' and a country code, e.g., +16175551212.', true) ->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true) ->inject('request') ->inject('response') @@ -67,7 +67,7 @@ App::post('/v1/account') ->inject('audits') ->inject('usage') ->inject('events') - ->action(function (string $userId, string $email, string $password, string $phone, string $name, Request $request, Response $response, Document $project, Database $dbForProject, Audit $audits, Stats $usage, Event $events) { + ->action(function (string $userId, ?string $email, string $password, ?string $phone, string $name, Request $request, Response $response, Document $project, Database $dbForProject, Audit $audits, Stats $usage, Event $events) { $email = \strtolower($email); if ('console' === $project->getId()) { $whitelistEmails = $project->getAttribute('authWhitelistEmails'); @@ -2278,7 +2278,7 @@ App::post('/v1/account/verification/phone') ->inject('messaging') ->action(function (Request $request, Response $response, Document $user, Database $dbForProject, Audit $audits, Event $events, Stats $usage, EventPhone $messaging) { - if (empty(App::getEnv('_APP_PHONE_PROVIDER'))) { + if (empty(App::getEnv('_APP_SMS_PROVIDER'))) { throw new Exception('Phone provider not configured', 503, Exception::GENERAL_PHONE_DISABLED); } diff --git a/app/views/install/compose.phtml b/app/views/install/compose.phtml index 4669066d7c..96bf005074 100644 --- a/app/views/install/compose.phtml +++ b/app/views/install/compose.phtml @@ -595,7 +595,7 @@ services: - _APP_REDIS_PASS mariadb: - image: mariadb:10.8.3 # fix issues when upgrading using: mysql_upgrade -u root -p + image: mariadb:10.7 # fix issues when upgrading using: mysql_upgrade -u root -p container_name: appwrite-mariadb <<: *x-logging restart: unless-stopped diff --git a/docker-compose.yml b/docker-compose.yml index a9b7c25eb7..88ad6f8d43 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -638,7 +638,7 @@ services: - _APP_REDIS_PASS mariadb: - image: mariadb:10.8.3 # fix issues when upgrading using: mysql_upgrade -u root -p + image: mariadb:10.7 # fix issues when upgrading using: mysql_upgrade -u root -p container_name: appwrite-mariadb <<: *x-logging networks: diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 283c76a34b..aaca0987b2 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -51,41 +51,6 @@ trait AccountBase $this->assertEquals($response['headers']['status-code'], 409); - $response = $this->client->call(Client::METHOD_POST, '/account', array_merge([ - 'origin' => 'http://localhost', - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ]), [ - 'userId' => 'unique()', - 'email' => '', - 'password' => '', - ]); - - $this->assertEquals($response['headers']['status-code'], 400); - - $response = $this->client->call(Client::METHOD_POST, '/account', array_merge([ - 'origin' => 'http://localhost', - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ]), [ - 'userId' => 'unique()', - 'email' => $email, - 'password' => '', - ]); - - $this->assertEquals($response['headers']['status-code'], 400); - - $response = $this->client->call(Client::METHOD_POST, '/account', array_merge([ - 'origin' => 'http://localhost', - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ]), [ - 'userId' => 'unique()', - 'email' => '', - 'password' => $password, - ]); - - $this->assertEquals($response['headers']['status-code'], 400); return [ 'id' => $id, diff --git a/tests/e2e/Services/Account/AccountCustomClientTest.php b/tests/e2e/Services/Account/AccountCustomClientTest.php index 474fe612eb..3d525d766a 100644 --- a/tests/e2e/Services/Account/AccountCustomClientTest.php +++ b/tests/e2e/Services/Account/AccountCustomClientTest.php @@ -690,7 +690,7 @@ class AccountCustomClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], ]), [ 'userId' => 'unique()', - 'number' => $number, + 'phone' => $number, ]); $this->assertEquals(201, $response['headers']['status-code']); @@ -869,7 +869,7 @@ class AccountCustomClientTest extends Scope 'x-appwrite-project' => $this->getProject()['$id'], 'cookie' => 'a_session_' . $this->getProject()['$id'] . '=' . $session, ]), [ - 'number' => $newPhone, + 'phone' => $newPhone, 'password' => 'new-password' ]);