Hono-Sessions, Cookie-Store, working for multiple domains

I have a client React app that consumes data from multiple backends. in development, those backends are - http://localhost:8001, - http://localhost:8002, - http://localhost:8003, ... and the authentication is handled from http://localhost:8000 In production, authentication is handled from - https://auth.domain.com and i have the servers spread out through different subdomains of the same domain. Right now, i'm using Bearer Authentication, with a token generated in the auth server, decoded by the same middleware imported in every other service. I would love to switch to cookie based session management, but i don't want to change the backend architecture setup. Is this possible with hono and hono-sessions? How? Thank you
3 Replies
Nico
Nico5mo ago
Are you using JWT middleware for Bearer Auth or Bearer Auth middleware? Because JWT will allow cookies or Auth header Also it will be very hard to setup with an reverse proxy, every port is seen as a different domain name so cookies won’t be set automatically
rubberduckies
rubberduckiesOP5mo ago
@nico i'm not sure i understand the first question... i gather from your answer, this will not be a good mission for me to set my sight on
Nico
Nico5mo ago
Unless you plan to setup a reverse proxy and keep them all on the same domain, it’s a pain to do in development. A lot of people have tried on here
Want results from more Discord servers?
Add your server