mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-04-28 04:29:27 -05:00
Commented out admin check, unsure as to whether or not more than one admin can exist
This commit is contained in:
@@ -59,20 +59,21 @@ const registerController = async (req, res, next) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if an admin user exists, if so, error
|
||||
try {
|
||||
const admin = await req.db.checkAdmin(req, res);
|
||||
console.log(admin);
|
||||
if (admin === true) {
|
||||
throw new Error(errorMessages.AUTH_ADMIN_EXISTS);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("WEEEEEEE", error.message);
|
||||
error.service = SERVICE_NAME;
|
||||
error.status = 403;
|
||||
next(error);
|
||||
return;
|
||||
}
|
||||
// TODO Can there be more than one admin?
|
||||
// // Check if an admin user exists, if so, error
|
||||
// try {
|
||||
// const admin = await req.db.checkAdmin(req, res);
|
||||
// console.log(admin);
|
||||
// if (admin === true) {
|
||||
// throw new Error(errorMessages.AUTH_ADMIN_EXISTS);
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.log("WEEEEEEE", error.message);
|
||||
// error.service = SERVICE_NAME;
|
||||
// error.status = 403;
|
||||
// next(error);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// Create a new user
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user