From 25fb810d815c77bf736053207bd899fa9f5db424 Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Tue, 21 Mar 2023 16:31:43 +0100 Subject: [PATCH] account-settings: Pass password page params to dialog widget. When the password change form was converted to a dialog widget modal, in commit f5fbf5f0e07f55, the page_params values for password_min_length and password_min_guesses that were referenced in the handlebars template `dialog_change_password.hbs` had no value to set, which meant the password quality bar was no longer checking the input value against those organization settings. Passes the page_params values for password_min_length and password_min_guesses to the html parameter in dialog_widet.launch for the password change modal so that those values are available and set when the template is rendered. --- web/src/settings_account.js | 5 ++++- web/templates/dialog_change_password.hbs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/settings_account.js b/web/src/settings_account.js index 473c188d6f..a23cf3dd1e 100644 --- a/web/src/settings_account.js +++ b/web/src/settings_account.js @@ -588,7 +588,10 @@ export function set_up() { dialog_widget.launch({ html_heading: $t_html({defaultMessage: "Change password"}), - html_body: render_dialog_change_password(), + html_body: render_dialog_change_password({ + password_min_length: page_params.password_min_length, + password_min_guesses: page_params.password_min_guesses, + }), html_submit_button: $t_html({defaultMessage: "Change"}), loading_spinner: true, id: "change_password_modal", diff --git a/web/templates/dialog_change_password.hbs b/web/templates/dialog_change_password.hbs index 5794a96176..3ba54befeb 100644 --- a/web/templates/dialog_change_password.hbs +++ b/web/templates/dialog_change_password.hbs @@ -10,7 +10,7 @@
+ data-min-length="{{password_min_length}}" data-min-guesses="{{password_min_guesses}}" />