This commit is contained in:
parent
1de1cb4086
commit
997fd760d2
11 changed files with 99 additions and 37 deletions
|
|
@ -6,7 +6,6 @@ from allauth.account.models import EmailAddress
|
|||
from allauth.socialaccount.providers.base import ProviderAccount
|
||||
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
|
||||
|
||||
|
||||
class OAuthAccount(ProviderAccount):
|
||||
def to_str(self):
|
||||
return self.account.extra_data.get("username")
|
||||
|
|
@ -18,14 +17,12 @@ class OAuthProvider(OAuth2Provider):
|
|||
account_class = OAuthAccount
|
||||
|
||||
def extract_uid(self, data):
|
||||
return str(data["username"])
|
||||
return str(data["preferred_username"])
|
||||
|
||||
def extract_common_fields(self, data):
|
||||
return dict(
|
||||
email=data.get("email"),
|
||||
username=data.get("username"),
|
||||
last_name=data.get("last_name"),
|
||||
first_name=data.get("first_name"),
|
||||
username=data.get("preferred_username"),
|
||||
)
|
||||
|
||||
def get_default_scope(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue