OAuth2 Redirect Causes CORS Error When Session is Missing and API is Accessed via XHR/Fetch #8519
Unanswered
hiep0810
asked this question in
Troubleshooting
Replies: 1 comment 1 reply
-
This is expected behavior as Google's OAuth2 endpoints don't support CORS, so XHR requests redirected to their authorization URLs are blocked by design. LibreChat does not use CORS. Also I suggest updating to the latest version: |
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
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
I'm self-hosting LibreChat with Google OAuth2 enabled.
After logging in successfully, when the
__Host-GCP_IAP_AUTH_TOKEN
cookie expires (e.g., after fully closing the browser, since its expiration is tied to the session), any subsequent XHR/fetch request to the backend (e.g., loading conversations) triggers a redirect to the Google OAuth2 authorization URL. However, this redirect causes a CORS error in the browser console, and the frontend shows a blank screen instead of gracefully redirecting to the login page.Version Information
LibreChat v0.7.8
Deployed via Docker
Auth method: Google OAuth2 (IAP-style)
Steps to Reproduce
__Host-GCP_IAP_AUTH_TOKEN
session cookie.https://accounts.google.com/o/oauth2/v2/auth?...
).What browsers are you seeing the problem on?
Chrome, Safari
Relevant log output
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions