Implementing a custom authentication backend based on email.