Files
GNX-mailEnterprise/venv/lib/python3.12/site-packages/allauth/socialaccount/providers/hubic/provider.py
Iliyan Angelov c67067a2a4 Mail
2025-09-14 23:24:25 +03:00

27 lines
686 B
Python

from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class HubicAccount(ProviderAccount):
pass
class HubicProvider(OAuth2Provider):
id = "hubic"
name = "Hubic"
account_class = HubicAccount
def extract_uid(self, data):
return str(data["email"])
def extract_common_fields(self, data):
return dict(
email=data.get("email"),
username=data.get("firstname").lower() + data.get("lastname").lower(),
first_name=data.get("firstname"),
last_name=data.get("lastname"),
)
provider_classes = [HubicProvider]