Skip to content

"staff_member_required"-solution in documentation (section installation at the end) leads to error for non_staff members #102

Open
@Danane84

Description

@Danane84

In the installation section of the documentation at the very end of the page, the following method is proposed to use the allauth authentication workflow (including two-factor authentication) for access the Django admin site:

admin.site.log = staff_member_required(admin.site.login, login_url = 'accounts/login')
admin.autodiscover()

However, if a registered user, who is not a staff member logs in, the result is an ERR_TOO_MANY_REDIRECTS error. I tried to come up with a solution by looking at the staff_member_required decorator in the django documentation but was not successful. I know it is not a django-allauth-2fa specific question, but since the above code snippet is from the documentation, I thought I give it a try.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions