瀏覽代碼

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) {