Skip to content

馃悰 Bug Report: Fix: Align frontend username validation with backend validation rules聽#709

Description

@Tanayajadhav1

馃摐 Description

Description:

Problem:
The frontend username validation in src/pages/Signup/Signup.tsx currently only allows letters and spaces:

/^[A-Za-z\s]+$/

However, the backend validation allows letters, numbers, and underscores:

/^[a-zA-Z0-9_]+$/

This creates an inconsistency where usernames that are valid on the backend are incorrectly rejected by the frontend before submission.

Expected Behavior:

  • Frontend validation should match backend validation rules exactly so that:
  • Valid usernames are accepted consistently across the application.
  • Users receive accurate validation feedback.
  • Registration behavior is predictable and reliable.

Proposed Fix:
Update username validation in src/pages/Signup/Signup.tsx to use:
/^[A-Za-z0-9_]+$/

Replace the current validation message:
Only letters are allowed

with:
Username can only contain letters, numbers, and underscores

Apply the same validation rule both during field validation and form submission validation.

Benefits:

  • Eliminates frontend/backend validation mismatch.
  • Allows valid usernames such as user_123 and john_doe.
  • Improves user experience by preventing false validation errors.
  • Keeps validation behavior consistent throughout the registration flow.

Affected File:
src/pages/Signup/Signup.tsx

Labels:
bug
frontend
validation
good first issue
gssoc
level:intermediate

i would like to work on this issue under gssoc'26

What browsers are you seeing the problem on?

No response

馃搩 Relevant Screenshots (Links)

No response

Activity

  1. nikita-sdev commented on Jun 10, 2026

    @nikita-sdev

    Hi @maintainers,

    I would like to work on this issue under GSSoC'26. I noticed that the frontend username validation regex does not match the backend validation rules, and I'd be happy to fix the inconsistency by updating both the validation logic and validation messages in src/pages/Signup/Signup.tsx.

    If this issue becomes available or if multiple contributors are allowed, please consider assigning it to me.

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions