-
-
Notifications
You must be signed in to change notification settings - Fork 4
feat: globalMiddleware option #163
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I missed this PR! one comment/question
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #163 +/- ##
==========================================
+ Coverage 36.82% 44.76% +7.94%
==========================================
Files 16 9 -7
Lines 410 239 -171
Branches 25 17 -8
==========================================
- Hits 151 107 -44
+ Misses 245 126 -119
+ Partials 14 6 -8 β View full report in Codecov by Sentry. π New features to boost your workflow:
|
Remove unused import
I noticed none of the auth modules for nuxt have tests for the logged in state. I decided to fix that and added tests that mock useHanko and useRequestEvent in a way that the middleware accepts the request as authenticated. |
π Linked issue
Closes #114
β Type of change
π Description
Adds a configuration option that adds a global middleware. This option requires being logged in for all pages (unless otherwise specified on the individual page)
Exposes and auto-imports the middleware functions (
hankoLoggedIn
,hankoLoggedOut
) so they can be imported in a simple and typesafe way.βΉοΈ Help / Review wanted
hankoLoggedIn
,hankoLoggedOut
) is necessary or the best way to make them accessible for building custom middleware on top of them.