[Enhancement]: Customizable cookie domain #10416
rajvatsal
started this conversation in
Feature Requests & Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Imagine a case where you are hosting LibreChat on a sub-domain and another service in another sub-domain. You want synchronize login and logout between those to services. Say if user logs into x and then he should also be logged into y.
One step of achieving this is set domain for cookies in
AuthServiceto a root domain. I would like a way of changing domain of the cookie without changing the source code.It has a very simple solution. Allow us to set an env variable which accepts the value of the cookie domain.
... COOKIE_DOMAIN=example.com ...In
AuthServicewe could use a constant variableCOOKIE_DOMAIN = process.env('COOKIE_DOMAIN') ?? ''Empty string would be equivalent to setting no domain (which is the current scenario)
We can also log it out in the backend for debugging.
logger.info([AuthService] cookies are set to domain ${COOKIE_DOMAIN || domains.server});Beta Was this translation helpful? Give feedback.
All reactions