mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2026-03-13 07:49:55 +08:00
Add simple solution to update of oauth with more consistent use of identifiers (#953)
This commit is contained in:
@@ -209,7 +209,11 @@ class BaseUserManager(Generic[models.UC, models.UD]):
|
||||
# Update oauth
|
||||
updated_oauth_accounts = []
|
||||
for existing_oauth_account in user.oauth_accounts: # type: ignore
|
||||
if existing_oauth_account.account_id == oauth_account.account_id:
|
||||
if (
|
||||
existing_oauth_account.account_id == oauth_account.account_id
|
||||
and existing_oauth_account.oauth_name == oauth_account.oauth_name
|
||||
):
|
||||
oauth_account.id = existing_oauth_account.id
|
||||
updated_oauth_accounts.append(oauth_account)
|
||||
else:
|
||||
updated_oauth_accounts.append(existing_oauth_account)
|
||||
|
||||
Reference in New Issue
Block a user