Update auth endpoints
This commit is contained in:
1 parent
4b35811897
commit
d2ab33492a
3 files changed
+104
-81
No files matched your search
@@ -49,23 +49,6 @@ const registerController = async (req, res, next) => {
|
||||
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 {
|
||||
const newUser = await req.db.insertUser({ ...req.body }, req.file);
|
||||
|
||||
Reference in new issue
Block a user