Replies: 1 comment 1 reply
-
Its fine! However you might want to Take a look into macros |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an auth module which handles user sessions. I want to write a plugin which uses some of elysias features to do e.g. cookie parsing and then enable type safe passing of user session related data. To do this, I wrote this module:
Now when I want to apply this to my handlers, this may look like this:
My problem is: Some of the handlers have more strict permission requirements. In this case, I want to make some of them available to logged in users and some simply should be public but I want to ensure that a session gets created whenever they hit an endpoint.
I think I'm kind of abusing guards at this point. What would be the best way to implement this? Is abusing the guard call ok if I just need its encapsulation?
Beta Was this translation helpful? Give feedback.
All reactions