Added optional default admin account

This commit is contained in:
2021-03-07 06:59:58 +11:00
parent aacd64a769
commit ac980426a5
7 changed files with 54 additions and 4 deletions
+1 -2
View File
@@ -51,10 +51,9 @@ const route = async (req, res) => {
const validateDetails = async (body) => {
//basic formatting (with an exception for the default admin account)
if (!validateEmail(body.email) && body.email != `admin@${process.env.WEB_ADDRESS}`) {
if (!validateEmail(body.email) && body.email != `${process.env.ADMIN_DEFAULT_USERNAME}@${process.env.WEB_ADDRESS}`) {
return 'invalid email';
}
//TODO: restore default admin account
//check for existing (banned)
//TODO: restore banning
+5
View File
@@ -78,6 +78,11 @@ const validateDetails = async (body) => {
return 'username already exists';
}
//validate password
if (body.password.length < 8) {
return 'password too short';
}
return null;
};