From ba620b28a31fb3ccaf7804b0d7c4aa4d9f463f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 6 May 2022 07:44:29 +0000 Subject: [PATCH] qa fixes --- app/controllers/api/account.php | 1 + src/Appwrite/Utopia/Response/Model/User.php | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 28f2e3b1e3..9dbfa7387b 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -66,6 +66,7 @@ App::post('/v1/account') /** @var Appwrite\Event\Event $audits */ /** @var Appwrite\Stats\Stats $usage */ + // TODO: Here and everywhere else.. If you dont provide options, it should not be default algo options.. it should be empty. Only default options if we also default algo $hashOptions = (\is_string($hashOptions)) ? \json_decode($hashOptions, true) : $hashOptions; // Cast to JSON array $email = \strtolower($email); diff --git a/src/Appwrite/Utopia/Response/Model/User.php b/src/Appwrite/Utopia/Response/Model/User.php index 1c1243df82..e49bdf809b 100644 --- a/src/Appwrite/Utopia/Response/Model/User.php +++ b/src/Appwrite/Utopia/Response/Model/User.php @@ -23,6 +23,12 @@ class User extends Model 'default' => '', 'example' => 'John Doe', ]) + ->addRule('password', [ + 'type' => self::TYPE_STRING, + 'description' => 'Hashed user password.', + 'default' => '', + 'example' => '$argon2id$v=19$m=2048,t=4,p=3$aUZjLnliVWRINmFNTWMudg$5S+x+7uA31xFnrHFT47yFwcJeaP0w92L/4LdgrVRXxE', + ]) ->addRule('hash', [ 'type' => self::TYPE_STRING, 'description' => 'Password hashing algorithm.',