2
0
Shun Miyazawa 3 жил өмнө
parent
commit
2af5f17f8e

+ 1 - 4
packages/app/src/server/routes/apiv3/user-activation.ts

@@ -159,13 +159,10 @@ export const validateRegisterForm = (req, res, next) => {
     return next();
   }
 
-  req.form = { isValid: false };
   const extractedErrors: string[] = [];
   errors.array().map(err => extractedErrors.push(err.msg));
 
-  req.flash('registerWarningMessage', extractedErrors);
-
-  res.redirect('back');
+  return res.apiv3Err(extractedErrors, 400);
 };
 
 async function makeRegistrationEmailToken(email, crowi) {