diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 6e7d437fd1..282a5d9a22 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -57,7 +57,7 @@ $utopia->post('/v1/account') ->label('sdk.description', '/docs/references/account/create.md') ->label('abuse-limit', 10) ->param('email', '', function () { return new Email(); }, 'User email.') - ->param('password', '', function () { return new Password(); }, 'User password.') + ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.') ->param('name', '', function () { return new Text(100); }, 'User name.', true) ->action( function ($email, $password, $name) use ($register, $request, $response, $audit, $projectDB, $project, $webhook, $oauth2Keys) { @@ -158,7 +158,7 @@ $utopia->post('/v1/account/sessions') ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},email:{param-email}') ->param('email', '', function () { return new Email(); }, 'User email.') - ->param('password', '', function () { return new Password(); }, 'User password.') + ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.') ->action( function ($email, $password) use ($response, $request, $projectDB, $audit, $webhook) { $protocol = Config::getParam('protocol'); @@ -745,8 +745,8 @@ $utopia->patch('/v1/account/password') ->label('sdk.namespace', 'account') ->label('sdk.method', 'updatePassword') ->label('sdk.description', '/docs/references/account/update-password.md') - ->param('password', '', function () { return new Password(); }, 'New user password.') - ->param('oldPassword', '', function () { return new Password(); }, 'Old user password.') + ->param('password', '', function () { return new Password(); }, 'New user password. Must be between 6 to 32 chars.') + ->param('oldPassword', '', function () { return new Password(); }, 'Old user password. Must be between 6 to 32 chars.') ->action( function ($password, $oldPassword) use ($response, $user, $projectDB, $audit, $oauth2Keys) { if (!Auth::passwordVerify($oldPassword, $user->getAttribute('password'))) { // Double check user password @@ -788,7 +788,7 @@ $utopia->patch('/v1/account/email') ->label('sdk.method', 'updateEmail') ->label('sdk.description', '/docs/references/account/update-email.md') ->param('email', '', function () { return new Email(); }, 'User email.') - ->param('password', '', function () { return new Password(); }, 'User password.') + ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.') ->action( function ($email, $password) use ($response, $user, $projectDB, $audit, $oauth2Keys) { if (!Auth::passwordVerify($password, $user->getAttribute('password'))) { // Double check user password @@ -1144,8 +1144,8 @@ $utopia->put('/v1/account/recovery') ->label('abuse-key', 'url:{url},userId:{param-userId}') ->param('userId', '', function () { return new UID(); }, 'User account UID address.') ->param('secret', '', function () { return new Text(256); }, 'Valid reset token.') - ->param('password', '', function () { return new Password(); }, 'New password.') - ->param('passwordAgain', '', function () {return new Password(); }, 'New password again.') + ->param('password', '', function () { return new Password(); }, 'New password. Must be between 6 to 32 chars.') + ->param('passwordAgain', '', function () {return new Password(); }, 'New password again. Must be between 6 to 32 chars.') ->action( function ($userId, $secret, $password, $passwordAgain) use ($response, $projectDB, $audit) { if ($password !== $passwordAgain) { diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index 7cd14e583c..2ffc3a0233 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -400,7 +400,7 @@ $utopia->delete('/v1/projects/:projectId') ->label('sdk.namespace', 'projects') ->label('sdk.method', 'delete') ->param('projectId', '', function () { return new UID(); }, 'Project unique ID.') - ->param('password', '', function () { return new UID(); }, 'Your user password for confirmation.') + ->param('password', '', function () { return new UID(); }, 'Your user password for confirmation. Must be between 6 to 32 chars.') ->action( function ($projectId, $password) use ($response, $consoleDB, $user, $deletes) { if (!Auth::passwordVerify($password, $user->getAttribute('password'))) { // Double check user password diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 3c0c6a40ca..12090ecc66 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -31,7 +31,7 @@ $utopia->post('/v1/users') ->label('sdk.method', 'create') ->label('sdk.description', '/docs/references/users/create-user.md') ->param('email', '', function () { return new Email(); }, 'User email.') - ->param('password', '', function () { return new Password(); }, 'User password.') + ->param('password', '', function () { return new Password(); }, 'User password. Must be between 6 to 32 chars.') ->param('name', '', function () { return new Text(100); }, 'User name.', true) ->action( function ($email, $password, $name) use ($response, $projectDB) {