-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add globalAppMiddleware
similar to sidebase module
#143
Comments
You should be able to use layouts to avoid repeating logic for all pages that needs authentication. |
When I have tried to put a So I'm not sure what is the designated way to add definePageMeta and auth to the layouts. Maybe if one of the playgrounds would use such technique that would help. |
Oh right, this is a page only feature. In that case you have a couple other options :
I think documenting either of these would be preferable than adding a global option. |
Thanks for the quick reply. The global middleware seems to be the best solution. I have a default layout which signs in the user if not already signed in, and that is applied without specifying any So I think this is indeed better than the global option. |
I agree, this should be natively supported. |
Describe the feature
For many applications it is desirable to default to requiring authentication and have specific pages be able to opt out. Currently this is not possible and one has to manually add
definePageMeta({ auth: true });
to every page. This is cumbersome and easy to forget. Please add aglobalAppMiddleware
similar to the one found in the sidebase package.Additional information
The text was updated successfully, but these errors were encountered: