File tree Expand file tree Collapse file tree
packages/divbase-api/src/divbase_api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ def edit_profile_failed_response(error_message: str):
111111 "request" : request ,
112112 "current_user" : current_user ,
113113 "swedish_universities" : SWEDISH_UNIVERSITIES ,
114+ "known_job_roles" : KNOWN_JOB_ROLES ,
114115 "name" : name ,
115116 "organisation" : organisation ,
116117 "organisation_other" : organisation_other ,
Original file line number Diff line number Diff line change @@ -4,11 +4,14 @@ Validates the user password for both registration and password reset:
441. Checks that the password and confirm password fields match.
552. Checks that the password is not one of the 10,000 most common passwords.
663. Min password length specified in HTML inputs
7+
8+ Will prevent form submission if issues.
79*/
810
911const passwordInput = document . getElementById ( 'password' ) ;
1012const confirmPasswordInput = document . getElementById ( 'confirm_password' ) ;
11- const registerForm = document . getElementById ( 'registerForm' ) ;
13+ const form = document . getElementById ( "registerForm" ) || document . getElementById ( "resetPasswordForm" ) ;
14+
1215let commonPasswords = new Set ( ) ;
1316
1417function validatePasswords ( ) {
@@ -35,10 +38,10 @@ async function setupPasswordValidation() {
3538 passwordInput . addEventListener ( 'input' , validatePasswords ) ;
3639 confirmPasswordInput . addEventListener ( 'input' , validatePasswords ) ;
3740
38- registerForm . addEventListener ( 'submit' , ( event ) => {
41+ form . addEventListener ( 'submit' , ( event ) => {
3942 validatePasswords ( ) ;
40- if ( ! registerForm . checkValidity ( ) ) {
41- event . preventDefault ( ) ; // Stop registration form submission
43+ if ( ! form . checkValidity ( ) ) {
44+ event . preventDefault ( ) ; // Stop form submission
4245 }
4346 } ) ;
4447
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ <h4 class="mt-2">Reset Your Password</h4>
1313 < p class ="text-muted "> Enter your new password for {{ email }}</ p >
1414 </ div >
1515
16- < form method ="post " action ="/reset-password ">
16+ < form method ="post " action ="/reset-password " id =" resetPasswordForm " >
1717 < input type ="hidden " name ="token " value ="{{ token }} ">
1818 < input type ="hidden " name ="email " value ="{{ email }} ">
1919
You can’t perform that action at this time.
0 commit comments