openwisp / openwisp/openwisp-radius

[bug] Registration fails when email local-part duplicates existing username (500 error)

Open
#685 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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
  1. Enable registration via openwisp-wifi-login-pages.
  2. Register user with email: johndae@gmail.com
  3. Register another user with email: johndae@yahoo.com
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.