Middleware not working properly #3036
Unanswered
deepakshrma30
asked this question in
Q&A
Replies: 1 comment
-
I'm not sure why, but way you set the middleware seems a bit odd though and doesn't match the description of the documentation. For instance in the documentation the usage of the middelware and the handler are separated, i.e.:
While you have them combined, so maybe it registers as middleware and not as handler (although it uses a different method I would expect it to still not match your get request). But worth a try:
|
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
-
I have a created a middleware using createMiddleware function from hono/factory , and i am using the middleware in some specific routes only
This is my middleware code :
export default authMiddleWare;
These are my two routes i am using the middleware this require authentication
This is my put request to update the blog
This is my get Request to get blogs but it do not need to have a middleware
My get Request throws unauthorized error from the authMiddleware but why?
Beta Was this translation helpful? Give feedback.
All reactions