Skip to content

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

@o1-spec

Description

@o1-spec

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:

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:
openwisp/openwisp-wifi-login-pages#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions