Implement secure account lock and certificate-based unlock flow
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user