refactor: Traduction en anglais des modules "GestionInscription" et

"GestionLogin"
This commit is contained in:
N3WT DE COMPET
2025-01-12 10:07:06 +01:00
parent 830d9a48c0
commit 2b414b8391
69 changed files with 1393 additions and 1551 deletions

20
Back-End/Auth/backends.py Normal file
View File

@ -0,0 +1,20 @@
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from Auth.models import Profile
from N3wtSchool import bdd
class EmailBackend(ModelBackend):
def authenticate(self, request, username=None, password=None, **kwargs):
if username is None:
username = kwargs.get(Profile.USERNAME_FIELD)
try:
user = Profile.objects.get(email=username)
# Vérifie le mot de passe de l'utilisateur
if user.check_password(password):
return user
except Profile.DoesNotExist:
return None