Skip to content

Commit 4f3f192

Browse files
authored
Merge pull request #1030 from rwos/fix-user-pw-creation
Fix typos in user creation with initial password
2 parents 8b9c941 + dac9861 commit 4f3f192

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/sprinkles/admin/schema/requests/user/create.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ passwordc:
9090
message: VALIDATE.REQUIRED
9191
matches:
9292
domain: client
93-
field: value
93+
field: password
9494
label: "&PASSWORD.CONFIRM"
9595
message: VALIDATE.PASSWORD_MISMATCH
9696
length:

app/sprinkles/admin/src/Controller/UserController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function create(Request $request, Response $response, $args)
167167
$passwordRequest = $this->ci->repoPasswordReset->create($user, $config['password_reset.timeouts.create']);
168168

169169
// If the password_mode is manual, do not send an email to set it. Else, send the email.
170-
if (!isset($data['value'])) {
170+
if ($data['password'] === '') {
171171
// Create and send welcome email with password set link
172172
$message = new TwigMailMessage($this->ci->view, 'mail/password-create.html.twig');
173173

@@ -786,8 +786,8 @@ public function getModalEditPassword(Request $request, Response $response, $args
786786

787787
// Load validation rules
788788
$schema = new RequestSchema('schema://requests/user/edit-password.yaml');
789-
$schema->set('value.validators.length.min', $config['site.password.length.min']);
790-
$schema->set('value.validators.length.max', $config['site.password.length.max']);
789+
$schema->set('password.validators.length.min', $config['site.password.length.min']);
790+
$schema->set('password.validators.length.max', $config['site.password.length.max']);
791791
$schema->set('passwordc.validators.length.min', $config['site.password.length.min']);
792792
$schema->set('passwordc.validators.length.max', $config['site.password.length.max']);
793793
$validator = new JqueryValidationAdapter($schema, $this->ci->translator);

0 commit comments

Comments
 (0)