Ë
    Œl)jÇ  ã                   óB   — d Z ddlmZ ddlmZ ddlmZ  G d„ de«      Zy)zÔ
Backends et regles d'authentification personnalises.

Ce fichier adapte la connexion des utilisateurs au besoin du projet, notamment
pour les usages par email et les contraintes de gestion des comptes internes.
é    )Úget_user_model)ÚModelBackend)ÚQc                   ó   — e Zd ZdZdd„Zy)ÚEmailAuthenticationBackendz;Authentifie un utilisateur par e-mail ou nom d'utilisateur.Nc                 ó  — t        «       }t        |xs@ |j                  |j                  «      xs# |xs |j                  |j                  «      xs d«      j                  «       }|r|€y|j                  }t        |¬«      t        di |› d�|i¤Žz  }	t        |j                  j                  |	«      dd «      }
t        |
«      dk7  r |«       j                  |«       y|
d   }|j                  |«      r| j                  |«      r|S y)	z=Authentifie un utilisateur a partir des identifiants fournis.Ú N)Úemail__iexactÚ__iexacté   é   r   © )r   ÚstrÚgetÚEMAIL_FIELDÚUSERNAME_FIELDÚstripr   ÚlistÚ_default_managerÚfilterÚlenÚset_passwordÚcheck_passwordÚuser_can_authenticate)ÚselfÚrequestÚusernameÚpasswordÚemailÚkwargsÚ
user_modelÚlogin_identifierÚusername_fieldÚlookupÚusersÚusers               úh/home/exaucensingi/Documents/ProjectPython/GBM_FacControl/faccontrol_acokin/facturation/auth_backends.pyÚauthenticatez'EmailAuthenticationBackend.authenticate   s  € ô $Ó%ˆ
ÜØò Ø�z‰z˜*×0Ñ0Ó1òàòð �z‰z˜*×3Ñ3Ó4òð ó
÷ ‰%‹'ð 	ñ   8Ð#3Øà#×2Ñ2ˆÜÐ!1Ô2´Qñ 6
Ø Ð! Ð*Ð,<Ð=ñ6
ñ 
ˆô �Z×0Ñ0×7Ñ7¸Ó?ÀÀÐCÓDˆÜˆu‹:˜Š?Ù‹L×%Ñ% hÔ/Øà�Q‰xˆà×Ñ˜xÔ(¨T×-GÑ-GÈÔ-MØˆKàó    )NNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r(   r   r)   r'   r   r      s
   „ ÙEôr)   r   N)r-   Údjango.contrib.authr   Údjango.contrib.auth.backendsr   Údjango.db.modelsr   r   r   r)   r'   ú<module>r1      s!   ðñõ /Ý 5Ý ô  õ  r)   