This commit is contained in:
Iliyan Angelov
2025-09-14 23:24:25 +03:00
commit c67067a2a4
71311 changed files with 6800714 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
from allauth.account.models import EmailAddress
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class DripAccount(ProviderAccount):
pass
class DripProvider(OAuth2Provider):
id = "drip"
name = "Drip"
account_class = DripAccount
def extract_uid(self, data):
# no uid available, we generate one by hashing the email
uid = hash(data.get("email"))
return str(uid)
def extract_common_fields(self, data):
return dict(email=data.get("email"), name=data.get("name"))
def extract_email_addresses(self, data):
ret = []
email = data.get("email")
if email:
ret.append(EmailAddress(email=email, verified=True, primary=True))
return ret
provider_classes = [DripProvider]