Преглед на файлове

fix throwing error for when registration is disabled

Pouria Ezzati преди 1 година
родител
ревизия
de6e30a9d7
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      server/handlers/auth.handler.js

+ 1 - 1
server/handlers/auth.handler.js

@@ -266,7 +266,7 @@ async function resetPassword(req, res, next) {
 
 function signupAccess(req, res, next) {
   if (!env.DISALLOW_REGISTRATION) return next();
-  return res.status(403).send({ message: "Registration is not allowed." });
+  throw new CustomError("Registration is not allowed.");
 }
 
 async function changeEmailRequest(req, res) {