✨ Adding meta defaults through router config #2563
Closed
jd-solanki
started this conversation in
Ideas
Replies: 1 comment
-
Using a navigation guard (a middleware in nuxt), is the way to go! Keep it that way 😄 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @posva 👋🏻
When using Nuxt, there's a default layout, and while developing production apps, we might need some defaults. For example, in my workflow, I set all pages to have the
authRequired
meta astrue
via guard (Nuxt middleware) and override it for certain public pages like login and register. There are also interesting use cases for setting meta defaults for flags like email verification required, etc.Currently, I have created Nuxt middleware that assigns these defaults before each navigation, but it would be great to avoid this additional runtime guard and have some built-in feature to extend or override from the defaults.
What are your thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions