Skip to content
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

fix: oauth user case sensitivity #4207

Merged
merged 7 commits into from
Jun 24, 2024
Merged

Conversation

matthewelwell
Copy link
Contributor

Changes

Resolves #4185.

The main goal of this PR is to ensure that users who authenticate with an OAuth provider after authenticating with email/password, another OAuth provider, or even SAML (although this use case is slim) get a consistent experience. Currently if the email differs by case, a new user will be created and the user will likely be confused as to why they can't see their projects, etc.

As a side effect, we had to handle a few edge cases where a user might already have duplicate accounts and make sure that the user gets the same experience they do today (authenticating with method A gets them into user A, authenticating with user B gets them user B).

We should, separate to this, get in touch with the users for whom this is an issue (~20) and try to merge their accounts.

How did you test this code?

Added 3 new tests to cover all scenarios.

@matthewelwell matthewelwell requested review from a team and novakzaballa and removed request for a team June 21, 2024 11:10
Copy link

vercel bot commented Jun 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Jun 21, 2024 4:12pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Jun 21, 2024 4:12pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Jun 21, 2024 4:12pm

@github-actions github-actions bot added api Issue related to the REST API fix labels Jun 21, 2024
@github-actions github-actions bot added fix and removed fix labels Jun 21, 2024
Copy link
Contributor

github-actions bot commented Jun 21, 2024

Uffizzi Preview deployment-53326 was deleted.

@github-actions github-actions bot added fix and removed fix labels Jun 21, 2024
Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.52%. Comparing base (e7fd8bd) to head (b4be67a).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4207      +/-   ##
==========================================
+ Coverage   96.51%   96.52%   +0.01%     
==========================================
  Files        1177     1177              
  Lines       38230    38354     +124     
==========================================
+ Hits        36896    37023     +127     
+ Misses       1334     1331       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added fix and removed fix labels Jun 21, 2024
@matthewelwell matthewelwell requested review from zachaysan and removed request for novakzaballa June 21, 2024 13:50
api/custom_auth/oauth/serializers.py Outdated Show resolved Hide resolved
@matthewelwell matthewelwell requested a review from a team as a code owner June 21, 2024 16:11
@matthewelwell matthewelwell requested review from novakzaballa and removed request for a team June 21, 2024 16:11
@github-actions github-actions bot added fix and removed fix labels Jun 21, 2024
@matthewelwell matthewelwell added this pull request to the merge queue Jun 24, 2024
Merged via the queue into main with commit af955bf Jun 24, 2024
25 checks passed
@matthewelwell matthewelwell deleted the fix/oauth-user-case-sensitivity branch June 24, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate user issue when using social auth
2 participants