You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I assumed the definePageMeta's set middleware to be executed prior to evaluating the validate property. Atleast, from what I understood, the middleware can be used for making sure that the current user is authenticated, while validation can be used for validating the that the user is on a page they're supposed to. This, because validation can be used to craft a factory that passes dynamic route parameters, something I was unable to adequately achieve using middlewares.
Now it seems that while testing, the validation is executed before the middleware layer, which will always make de validation layer fail because no authentication has been done yet, and no user passed to the context to use in the validation layer.
Anyone have any suggestion or alternative approaches on how to go about this problem? Or shouldn't the validation layer execute before the middleware after all?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I assumed the
definePageMeta
's setmiddleware
to be executed prior to evaluating thevalidate
property. Atleast, from what I understood, the middleware can be used for making sure that the current user is authenticated, while validation can be used for validating the that the user is on a page they're supposed to. This, because validation can be used to craft a factory that passes dynamic route parameters, something I was unable to adequately achieve using middlewares.Now it seems that while testing, the validation is executed before the middleware layer, which will always make de validation layer fail because no authentication has been done yet, and no user passed to the context to use in the validation layer.
Anyone have any suggestion or alternative approaches on how to go about this problem? Or shouldn't the validation layer execute before the middleware after all?
Thanks in advance.
EDIT: wrong repo
Beta Was this translation helpful? Give feedback.
All reactions