Files
kavehhn 192c595c68 feat: add password change, class unenroll, and optional notify flags
Let admins skip SMS on user, class, and invoice actions, and let users change their own password with the current one.
2026-08-15 23:48:18 +03:30

18 lines
367 B
JavaScript

// /utils/passwordRules.js
'use strict';
const AppError = require('./AppError');
const MIN_PASSWORD_LENGTH = 6;
const assertPasswordStrength = (password) => {
if (typeof password !== 'string' || password.trim().length < MIN_PASSWORD_LENGTH) {
throw new AppError('WEAK_PASSWORD');
}
};
module.exports = {
MIN_PASSWORD_LENGTH,
assertPasswordStrength
};