8000 Fix user identity attaching to wrong user by stnguyen90 · Pull Request #7280 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix user identity attaching to wrong user #7280

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

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

stnguyen90
Copy link
Contributor
@stnguyen90 stnguyen90 commented Dec 13, 2023

What does this PR do?

Suppose a user has 2 accounts on Appwrite:

  1. joe@example.com
  2. joe@gmail.com

Prior to this PR, if joe@example.com created a Google OAuth2 session using his joe@gmail.com email, a new joe@gmail.com identity would be created linked to joe@example.com.

This is especially problematic because if the user tried to create a Google OAuth2 session using joe@gmail.com, Appwrite would lookup the user via email and find the joe@gmail.com user, but then find an identity from joe@example.com. This mismatching user ID would then cause an error.

This PR prevents an identity from being created if the email from the OAuth2 provider matches another user's email.

Fixes #7190

Test Plan

Confirmed an error occurs when trying to link an identity when a user with the same email already exists:

image

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

Suppose a user has 2 accounts on Appwrite:

1. joe@example.com
2. joe@gmail.com

Prior to this PR, if joe@example.com created a Google OAuth2 session
using his joe@gmail.com email, a new joe@gmail.com identity would be
created linked to joe@example.com.

This is especially problematic because if the user tried to create a
Google OAuth2 session using joe@gmail.com, Appwrite would lookup the
user via email and find the joe@gmail.com user, but then find an
identity from joe@example.com. This mismatching user ID would then
cause an error.

This PR prevents an identity from being created if the email from the
OAuth2 provider matches another user's email.
@TorstenDittmann TorstenDittmann merged commit 0fdc28e into main Dec 28, 2023
@TorstenDittmann TorstenDittmann deleted the fix-7190-user-identity-incorrect-user branch December 28, 2023 01:00
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.

🐛 Bug Report: User identity attached to user even though account with matching email exists
2 participants
0