In the first form you type the username and password. If this is correct then you move to the second step, which is typing the 2fa token.
I want to verify with the first form if the user is superuser or not. If it is then I want to type a message in the second step (2fa token form)
In my two_factor/core/login.html template I write:
{% if backup_tokens %}
{% if user.is_superuser %}
<p>superuser</p>
{% endif %}
...
...
{% endif %}
But it doesn't work. I also tried with user.is_authenticated and request.user.is_superuser. I'm surprised that not even the former works. Is this a bug? I just want to reach the second step with a special message if it is a superuser
Python version: +3.9.2
Django version : +4.0.3
django-otp version: +1.1.3
django-two-factor-auth version : +1.13.2
In the first form you type the username and password. If this is correct then you move to the second step, which is typing the 2fa token.
I want to verify with the first form if the user is superuser or not. If it is then I want to type a message in the second step (2fa token form) In my two_factor/core/login.html template I write:
But it doesn't work. I also tried with
user.is_authenticated
andrequest.user.is_superuser
. I'm surprised that not even the former works. Is this a bug? I just want to reach the second step with a special message if it is a superuserPython version: +3.9.2 Django version : +4.0.3 django-otp version: +1.1.3 django-two-factor-auth version : +1.13.2