Implement secure account lock and certificate-based unlock flow

This commit is contained in:
2026-04-07 15:45:08 -05:00
parent 46a11728b8
commit 9a8e70c943
13 changed files with 528 additions and 10 deletions
+13 -1
View File
@@ -43,6 +43,11 @@ const changePasswordSchema = Joi.object({
newPassword: Joi.string().max(100).required().custom(isStrongPassword),
});
const unlockAccountSchema = Joi.object({
certPassword: Joi.string().required(),
newPassword: Joi.string().max(100).required().custom(isStrongPassword),
});
const validateRegisterMultipart = (req, res, next) => {
const { email, password, certPassword, consentAccepted } = req.body;
const issues = [];
@@ -88,4 +93,11 @@ const validate = (schema) => (req, res, next) => {
next();
};
module.exports = { validate, validateRegisterMultipart, loginSchema, refreshSchema, changePasswordSchema };
module.exports = {
validate,
validateRegisterMultipart,
loginSchema,
refreshSchema,
changePasswordSchema,
unlockAccountSchema,
};