{"record":{"id":"2869ab6ee6331346","repo":"theonedev/onedev","slug":"please-confirm-the-password","errorCode":null,"errorMessage":"Please confirm the password.","messagePattern":"Please confirm the password\\.","errorType":"validation","errorClass":"ConversionException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/web/editable/password/ConfirmativePasswordPropertyEditor.java","lineNumber":72,"sourceCode":"\t\t\t\tonPropertyUpdating(target);\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tinputAgain.add(new OnTypingDoneBehavior() {\n\n\t\t\t@Override\n\t\t\tprotected void onTypingDone(AjaxRequestTarget target) {\n\t\t\t\tonPropertyUpdating(target);\n\t\t\t}\n\t\t\t\n\t\t});\n\t}\n\n\t@Override\n\tprotected String convertInputToValue() throws ConversionException {\n\t\tif (input.getConvertedInput() != null) {\n\t\t\tif (inputAgain.getConvertedInput() == null)\n\t\t\t\tthrow new ConversionException(_T(\"Please confirm the password.\"));\n\t\t\telse if (!input.getConvertedInput().equals(inputAgain.getConvertedInput()))\n\t\t\t\tthrow new ConversionException(_T(\"Password and its confirmation should be identical.\"));\n\t\t\telse\n\t\t\t\treturn input.getConvertedInput();\n\t\t} else if (inputAgain.getConvertedInput() != null) {\n\t\t\tthrow new ConversionException(_T(\"Password and its confirmation should be identical.\"));\n\t\t} else {\n\t\t\treturn input.getConvertedInput();\n\t\t}\n\t}\n\n\t@Override\n\tpublic boolean needExplicitSubmit() {\n\t\treturn true;\n\t}\n\n}\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/web/editable/password/ConfirmativePasswordPropertyEditor.java#L54-L90","documentation":"ConfirmativePasswordPropertyEditor validates a password and its confirmation field during Wicket form conversion. If the main password field has a value but the confirmation field is empty, it throws this ConversionException so the form is rejected with a user-facing message.","triggerScenarios":"Submitting a form with this editor where input (password) is non-null but inputAgain (confirm password) was left blank.","commonSituations":"Users typing a new password but skipping the 'confirm password' field in property editors (e.g. user/admin account forms in OneDev).","solutions":["Type the same password into the confirmation field before submitting.","If building a custom editor, ensure both fields are bound and rendered so the confirmation input is converted.","Adjust UI validation to require confirmation whenever the password field is filled."],"exampleFix":"// before: only password filled\npassword = \"secret\"; confirm = null;\n// after\npassword = \"secret\"; confirm = \"secret\";","handlingStrategy":"validation","validationCode":"function canSubmit(pwd, confirm){ return pwd ? confirm != null : true; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always fill both password fields.","Enable client-side required validation on the confirm field when password is entered.","Leave both blank when not changing a password."],"tags":["wicket","form-validation","password"],"backgroundTag":"empty-required-field","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}