Skip to content

Fix: GitHub OAuth: use === instead of = in user email matching (#3877)#3892

Merged
raclim merged 1 commit intoprocessing:developfrom
Nixxx19:fix-github-oauth-comparison-3877
Feb 17, 2026
Merged

Fix: GitHub OAuth: use === instead of = in user email matching (#3877)#3892
raclim merged 1 commit intoprocessing:developfrom
Nixxx19:fix-github-oauth-comparison-3877

Conversation

@Nixxx19
Copy link
Contributor

@Nixxx19 Nixxx19 commented Feb 15, 2026

Fixes #3877

Changes

  • File: server/config/passport.js (line 180)
  • Fix: In the .find() callback when resolving which existing user to link for multiple accounts with the same GitHub emails, changed (u) => (u.email = primaryEmail) to (u) => (u.email === primaryEmail).
  • Impact: .find() now correctly returns the user whose email matches primaryEmail instead of the first user, and no longer mutates u.email during iteration, preventing wrong account linking and silent corruption of other users' email fields.

Verification

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #3877
  • meets the standards outlined in the accessibility guidelines

@raclim raclim merged commit 700985e into processing:develop Feb 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assignment operator (=) used instead of comparison (===) in GitHub OAuth user matching

2 participants