feat(account): WIP

This commit is contained in:
Tom Hubrecht 2024-10-09 10:41:15 +02:00
parent 6caf3dbf61
commit f6fcd90622
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc

View file

@ -1,3 +1,4 @@
import logging
from functools import lru_cache
from typing import Optional
@ -11,6 +12,8 @@ from django.utils.translation import gettext_lazy as _
from dgsi.models import Translation, User
logger = logging.getLogger(__name__)
class SharedAccountAdapter(DefaultSocialAccountAdapter):
"""
@ -49,6 +52,7 @@ class SharedAccountAdapter(DefaultSocialAccountAdapter):
return sociallogin.account.extra_data["preferred_username"]
case _:
logger.warning(sociallogin.user)
# INFO: This should never happen
messages.error(request, _("Méthode de connexion invalide."))
raise ImmediateHttpResponse(