Skip to content

accounts: Invalid roll numbers being allowed during registration #1

Open
@Prater-12

Description

@Prater-12

Describe the bug
During user registration, users are able to create accounts with invalid values of roll numbers. For example:

  • username, helloFOSS, notarollnumber123 (non-roll number strings)
  • 23M9999 (invalid roll numbers)
  • 26B1001 (roll numbers that are technically valid, but of future batches)

There is no validation being performed to ensure that the roll number is valid.

To Reproduce
Steps to reproduce the behavior:

  1. Run the backend
  2. Access the user registration end-point
  3. Try to create a user with an invalid roll number
  4. No error, user is created

Expected behavior
In the case of invalid values for the roll number, the backend must not create the user, and respond with an error.

Screenshots
None

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Brave

Additional context
NOTE: The implemented approach should account for users created for admin access, with "roll numbers" that technically act as usernames (ex. "admin"). Such users will always be created manually on the database level however, so it not a big concern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendRelated to the backendbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions