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.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// /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
|
||||
};
|
||||
Reference in New Issue
Block a user