openwisp / openwisp/openwisp-radius
[bug] Registration fails when email local-part duplicates existing username (500 error)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 445
- Forks
- 234
- Avg merge
- 20h 21m
- Merged PRs (30d)
- 19
Description
Problem
When registering users through openwisp-wifi-login-pages, if two users share the same email local-part but use different domains, registration fails with a 500 error.
Example:
- johndae@gmail.com
- johndae@yahoo.com
Investigation
In openwisp-wifi-login-pages, the frontend sends:
username: email
and the Node/Express layer proxies it to registerUrl without modifying the username.
So the username collision appears to happen server-side.
Related discussion:
https://github.com/openwisp/openwisp-wifi-login-pages/issues/793
Steps to Reproduce
- Enable registration via openwisp-wifi-login-pages.
- Register user with email: johndae@gmail.com
- Register another user with email: johndae@yahoo.com
- Observe 500 internal server error.
Expected Behavior
Registration should not fail when two emails share the same local-part but have different domains.
The backend should ensure username uniqueness (e.g., append suffix or handle collision gracefully).
Actual Behavior
Registration fails with an internal server error due to username collision.
System Information
- OS: macOS 26.2 (Build 25C56)
- Python version: 3.14.3
- Django version: 6.0.2
- openwisp-radius version: 1.3a0 (editable install from repo)
Note: If Python/Django versions above are outside the supported matrix, I can retest using the recommended versions.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the registration flow from openwisp-wifi-login-pages through the Node/Express proxy to registerUrl, focusing on how the email becomes a username. Reproduce the case with johndae@gmail.com and johndae@yahoo.com, then verify that both registrations complete without a 500 error and that username uniqueness is handled consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, express, node.js, python
- Domain
- api, authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100