backends.py

The standard email backend is replaced by a custom ModelBackend that supports getting the user based on the stored hmac email value.

Class definitions:

class core.backends.EmailBackend[source]

Bases: django.contrib.auth.backends.ModelBackend

Custom authentication backend which uses the hmac email address rather than the username to authenticate.

authenticate(email=None, password=None, username=None, **kwargs)[source]

Processes an authentication attempt

args:
  • email: not used
  • password: the password to check
  • username: the plain-text email address to search for
Returns:
the user if found and password correct else None.