From 5486cc5b2dc55ea20ced2ac673ad9e5a1c5f8665 Mon Sep 17 00:00:00 2001 From: Bertrand Zuchuat Date: Mon, 20 Mar 2023 08:39:00 +0100 Subject: [PATCH] circulation: fix password change on patron profile Co-Authored-by: Bertrand Zuchuat --- .../change-password-form/change-password-form.component.ts | 7 ++----- projects/shared/src/lib/api/user-api.service.ts | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.ts b/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.ts index c4af57ccd..5190c7db9 100644 --- a/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.ts +++ b/projects/admin/src/app/circulation/patron/change-password-form/change-password-form.component.ts @@ -104,15 +104,12 @@ export class ChangePasswordFormComponent implements OnInit { this.formFields = [ { key: 'password', - type: 'input', + type: 'passwordGenerator', focus: true, templateOptions: { - type: 'password', + api: "/api/user/password/generate", label: this._translateService.instant('New password'), required: true, - // same as Invenio - minLength: 6, - maxLength: 128, keydown: (field, event) => { if (event.key === 'Enter') { event.preventDefault(); diff --git a/projects/shared/src/lib/api/user-api.service.ts b/projects/shared/src/lib/api/user-api.service.ts index 5d51b40cb..1e3006d21 100644 --- a/projects/shared/src/lib/api/user-api.service.ts +++ b/projects/shared/src/lib/api/user-api.service.ts @@ -58,7 +58,8 @@ export class UserApiService { public changePassword(username: string, password: string) { const data = { username, - new_password: password + new_password: password, + new_password_confirm: password }; const url = `${this._apiPrefix}/change-password`; return this._httpClient.post(url, data);