fix oauth
All checks were successful
Docker / build (release) Successful in 9s

This commit is contained in:
krek0 2026-05-17 06:36:48 +02:00
parent 1de1cb4086
commit 997fd760d2
11 changed files with 99 additions and 37 deletions

View file

@ -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):