wncc / Hello-FOSS-SOC-Portal

This is the official repository of SOC Portal by TTY-17 WnCC, IITB
3 stars 15 forks source link

BUG: Invalid roll numbers being allowed during registration #11

Closed coldicedcoffee closed 1 month ago

coldicedcoffee commented 1 month ago

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:

Run the backend Access the user registration end-point Try to create a user with an invalid roll number 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.

AdityaK1729 commented 1 month ago

I have created a PR please check

AdityaK1729 commented 1 month ago

nice :)