# Path: feedhq/profiles/forms.py
# class AuthForm(AuthenticationForm):
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         self.fields['username'].label = _('Username or Email')


from functools import wraps
from django.contrib.auth import REDIRECT_FIELD_NAME
from ratelimitbackend.views import login
from .profiles.forms import AuthForm





def login_required(view_callable):
    def check_login(request, *args, **kwargs):
        if request.user.is_authenticated:
            return view_callable(request, *args, **kwargs)

        assert hasattr(request, 'session'), "Session middleware needed."
        login_kwargs = {
            'extra_context': {
                REDIRECT_FIELD_NAME: request.get_full_path(),
                'from_decorator': True,
            },

# Path: feedhq/profiles/forms.py
# class AuthForm(AuthenticationForm):
#     def __init__(self, *args, **kwargs):
#         super().__init__(*args, **kwargs)
#         self.fields['username'].label = _('Username or Email')


# Path: feedhq/decorators.py
from functools import wraps
from django.contrib.auth import REDIRECT_FIELD_NAME
from ratelimitbackend.views import login
from .profiles.forms import AuthForm






def login_required(view_callable):
    def check_login(request, *args, **kwargs):
        if request.user.is_authenticated:
            return view_callable(request, *args, **kwargs)

        assert hasattr(request, 'session'), "Session middleware needed."
        login_kwargs = {
            'extra_context': {
                REDIRECT_FIELD_NAME: request.get_full_path(),
                'from_decorator': True,
            },

            'authentication_form': AuthForm,