-
-
Notifications
You must be signed in to change notification settings - Fork 579
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
Use Signed Cookies in jwt Middleware #2398
Comments
Lain in Discord mentioned having this issue in January 8th in Cloudflare. |
I think the cookie value is not set in the header property, so JWT middleware can't read it. JWT middleware will read the cookie header in the Request object. Could you confirm that your request has the correct cookie? |
I logged the headers to the console and was able to see the cookies at the time of the request. I forgot that in my application I am using the |
Facing the same issue, JWT middleware is unable to work with cookies that were signed. If the cookie wasn't signed then JWT middleware is able to parse it correctly without any 401. |
What version of Hono are you using?
4.1.3
What runtime/platform is your app running on?
Node.JS
What steps can reproduce the bug?
Set up a signed cookie with jwt:
Then set up the jwt middleware:
What is the expected behavior?
I should be able to access a resource when the cookie is set.
What do you see instead?
Trying to access a resource that is using the jwt middleware returns with a 401.
Additional information
jwt middleware needs a parameter to specify the secret for the cookie and needs to be able to handle signed cookies.
The text was updated successfully, but these errors were encountered: