-
-
Couldn't load subscription status.
- Fork 461
Open
Labels
Description
If the current site is hosted on a non-standard port, e.g. 8000 is used by Django's runserver command, get_otpauth_url will generate a URL that has multiple : in the label section which in turn causes FreeOTP to reject the token as invalid
Expected Behavior
The token is valid, FreeOTP accepts the URL/secret key via QR code and setup can be completed
Current Behavior
FreeOTP throws an error
Possible Solution
According to this document:
Neither issuer nor account name may themselves contain a colon
get_otpauth_url should either strip or replace additional colons
Steps to Reproduce (for bugs)
- Start
python manage.py runserver - Start 2FA setup
- Scan the QR code with FreeOTP
Context
While investigating #767 I ran into this bug and it made going through setup multiple times more of a chore than was necessary.
Your Environment
- Browser and version: Firefox
- Python version: 3.12
- Django version: 5.2.1
- django-otp version: 1.6.0
- django-two-factor-auth version: 1.17.0
- Link to your project: https://github.com/jazzband/django-two-factor-auth