class AllauthOverrideMiddleware:
    """
    A middleware to implement a custom user flow
    """

def __init__(self):
    self.url_social = re.compile('^/accounts/.*$')

def process_request(self, request):
    pass
Changing django-allauth render_authentication_error behavior