diff --git a/lib/app/client.js b/lib/app/client.js index c2c5b0c4bd..5fc86c11ab 100644 --- a/lib/app/client.js +++ b/lib/app/client.js @@ -292,15 +292,14 @@ async function render (to, from, next) { // Call .validate() let isValid = true - let validationError try { for (const Component of Components) { if (typeof Component.options.validate !== 'function') { continue } - + isValid = await Component.options.validate(app.context) - + if (!isValid) { break } diff --git a/lib/app/server.js b/lib/app/server.js index 4e0f1c5e78..b419e2ecdd 100644 --- a/lib/app/server.js +++ b/lib/app/server.js @@ -154,7 +154,6 @@ export default async (ssrContext) => { ** Call .validate() */ let isValid = true - let validationError try { for (const Component of Components) { if (typeof Component.options.validate !== 'function') {