Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

[Bug]: Same email, different social logins results in "Internal Server Error" #6228

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

Closed
1 task done
xoChrisCo opened this issue Mar 8, 2025 · 1 comment
Closed
1 task done
Assignees
Labels
🐛 bug Something isn't working

Comments

@xoChrisCo
Copy link

What happened?

It's a bit hard to fully replicate, but it seems that if I log in using Microsoft (OpenID). I log back out, and try to log in using Google with the same email address, I get "Internal Server Error".

The expected behavior is that you would get logged into the same user account. It would be great not having to remember what social login you used when you logged in the first time.

Version Information

docker images | grep librechat
ghcr.io/danny-avila/librechat-dev-api latest 2b39288e7f09 15 hours ago 996MB
ghcr.io/danny-avila/librechat-dev-api ffbaf67e3e86 38 hours ago 1.01GB
ghcr.io/danny-avila/librechat-rag-api-dev-lite latest 6550e7ddf180 38 hours ago 1.3GB
ghcr.io/danny-avila/librechat-dev-api 21097aaf331a 4 days ago 1.01GB
ghcr.io/danny-avila/librechat-rag-api-dev-lite 095db2c2ff3b 2 months ago 1.29GB

Steps to Reproduce

  1. Log in using a Microsoft account (OpenID)
  2. Log out
  3. Log in using the same email on Google

What browsers are you seeing the problem on?

Chrome

Relevant log output

Screenshots

LibreChat-API | 2025-03-08T09:01:47.247Z info: Server listening on all interfaces at port 3080. Use http://localhost:3080 to access it
LibreChat-API | TokenError: Bad Request
LibreChat-API | at OAuth2Strategy.parseErrorResponse (/app/node_modules/passport-oauth2/lib/strategy.js:373:12)
LibreChat-API | at OAuth2Strategy._createOAuthError (/app/node_modules/passport-oauth2/lib/strategy.js:420:16)
LibreChat-API | at /app/node_modules/passport-oauth2/lib/strategy.js:177:45
LibreChat-API | at /app/node_modules/oauth/lib/oauth2.js:196:18
LibreChat-API | at passBackControl (/app/node_modules/oauth/lib/oauth2.js:132:9)
LibreChat-API | at IncomingMessage. (/app/node_modules/oauth/lib/oauth2.js:157:7)
LibreChat-API | at IncomingMessage.emit (node:events:530:35)
LibreChat-API | at endReadableNT (node:internal/streams/readable:1698:12)
LibreChat-API | at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
chat-mongodb | {"t":{"$date":"2025-03-08T09:01:56.678+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"[REDACTED_IP]:[REDACTED_PORT]","uuid":{"uuid":{"$uuid":"[REDACTED_UUID]"}},"connectionId":15,"connectionCount":15}}
chat-mongodb | {"t":{"$date":"2025-03-08T09:01:56.679+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn15","msg":"client metadata","attr":{"remote":"[REDACTED_IP]:[REDACTED_PORT]","client":"conn15","negotiatedCompressors":[],"doc":{"driver":{"name":"nodejs","version":"4.17.2"},"platform":"Node.js v20.18.3, LE","os":{"name":"linux","architecture":"x64","version":"6.8.0-55-generic","type":"Linux"}}}}
chat-mongodb | {"t":{"$date":"2025-03-08T09:01:56.719+00:00"},"s":"I", "c":"NETWORK", "id":22943, "ctx":"listener","msg":"Connection accepted","attr":{"remote":"[REDACTED_IP]:[REDACTED_PORT]","uuid":{"uuid":{"$uuid":"[REDACTED_UUID]"}},"connectionId":16,"connectionCount":16}}
chat-mongodb | {"t":{"$date":"2025-03-08T09:01:56.720+00:00"},"s":"I", "c":"NETWORK", "id":51800, "ctx":"conn16","msg":"client metadata","attr":{"remote":"[REDACTED_IP]:[REDACTED_PORT]","client":"conn16","negotiatedCompressors":[],"doc":{"driver":{"name":"nodejs|Mongoose","version":"6.12.0|8.9.5"},"platform":"Node.js v20.18.3, LE","os":{"name":"linux","architecture":"x64","version":"6.8.0-55-generic","type":"Linux"},"env":{"container":{"runtime":"docker"}}}}}
LibreChat-API | 2025-03-08T09:02:00.221Z info: [openidStrategy] verify login openidId: [REDACTED_ID]
LibreChat-API | 2025-03-08T09:02:00.223Z debug: [openidStrategy] very login tokenset and userinfo
LibreChat-API | {
LibreChat-API | tokenset.token_type: "Bearer",
LibreChat-API | tokenset.scope: "email openid profile",
LibreChat-API | tokenset.expires_at: 1741428316,
LibreChat-API | tokenset.ext_expires_in: 3796,
LibreChat-API | tokenset.access_token: "[REDACTED_TOKEN]",
LibreChat-API | tokenset.id_token: "[REDACTED_TOKEN]",
LibreChat-API | tokenset.session_state: "[REDACTED_SESSION_STATE]",
LibreChat-API | userinfo.sub: "[REDACTED_ID]",
LibreChat-API | userinfo.name: "[REDACTED_NAME]",
LibreChat-API | userinfo.family_name: "[REDACTED_SURNAME]",
LibreChat-API | userinfo.given_name: "[REDACTED_FIRSTNAME]",
LibreChat-API | userinfo.picture: "[REDACTED_URL]",
LibreChat-API | userinfo.email: "[REDACTED_EMAIL]",
LibreChat-API | }
LibreChat-API | 2025-03-08T09:02:00.236Z info: [openidStrategy] user found with openidId: [REDACTED_ID]
LibreChat-API | 2025-03-08T09:02:00.281Z error: [openidStrategy] downloadImage: Error downloading image at URL "[REDACTED_URL]": Error: Forbidden (HTTP 403)
LibreChat-API | 2025-03-08T09:02:00.297Z info: [openidStrategy] login success openidId: [REDACTED_ID] | email: [REDACTED_EMAIL] | username: [REDACTED_USERNAME]
chat-meilisearch | 2025-03-08T09:02:00.678714Z INFO HTTP request{method=GET host="meilisearch:7700" route=/health query_parameters= user_agent=node status_code=200}: meilisearch: close time.busy=113µs time.idle=220µs
LibreChat-API | 2025-03-08T09:02:00.801Z debug: [validateJson] files
LibreChat-API | [""Ai_PDF.json"",""BrowserOp.json"",""Dr_Thoths_Tarot.json"",""DreamInterpreter.json"",""VoxScript.json"",""askyourpdf.json"",""drink_maestro.json"",""earthImagesAndVisualizations.json"",""image_prompt_enhancer.json"",""qrCodes.json"",""scholarai.json"",""uberchord.json"",""web_search.json""]
LibreChat-API | 2025-03-08T09:02:07.258Z error: [googleLogin] Cannot read properties of undefined (reading 'includes')
LibreChat-API | TypeError: Cannot read properties of undefined (reading 'includes')
LibreChat-API | at handleExistingUser (/app/api/strategies/process.js:24:62)
LibreChat-API | at Strategy._verify (/app/api/strategies/socialLogin.js:17:15)
LibreChat-API | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@xoChrisCo xoChrisCo added the 🐛 bug Something isn't working label Mar 8, 2025
@rubentalstra rubentalstra self-assigned this Mar 8, 2025
@rubentalstra
Copy link
Collaborator

going to pick this up 👌

Repository owner locked and limited conversation to collaborators Apr 28, 2025
@danny-avila danny-avila converted this issue into discussion #7112 Apr 28, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants