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.',