summaryrefslogtreecommitdiffstats
path: root/ogcp/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp/static/js')
-rw-r--r--ogcp/static/js/ogcp.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js
index 6a7e625..4605e5d 100644
--- a/ogcp/static/js/ogcp.js
+++ b/ogcp/static/js/ogcp.js
@@ -231,3 +231,25 @@ function digestLoginPassword() {
$(this).submit()
});
}
+
+function digestUserFormPassword() {
+ const loginForm = $('#user-form')
+ loginForm.one('submit', async function (event) {
+ event.preventDefault()
+
+ const pwdInput = $('#pwd');
+ const pwdHashInput = $('#pwd_hash');
+ const pwdStr = pwdInput.val();
+ const pwdStrHash = await digestMessage(pwdStr);
+
+ const pwdConfirmInput = $('#pwd_confirm');
+ const pwdHashConfirmInput = $('#pwd_hash_confirm');
+ const pwdConfirmStr = pwdConfirmInput.val();
+ const pwdConfirmStrHash = await digestMessage(pwdConfirmStr);
+
+ pwdInput.prop( "disabled", true );
+ pwdHashInput.val(pwdStrHash);
+ pwdHashConfirmInput.val(pwdConfirmStrHash);
+ $(this).submit()
+ });
+}