hngprojects / hng_boilerplate_python_fastapi_web

Apache License 2.0
154 stars 136 forks source link

[FIX] Invalid domain part allowed in email during Registration #918

Open johnson-oragui opened 4 weeks ago

johnson-oragui commented 4 weeks ago

Describe the bug During user registration, the local part of the email is properly validated, as well as the domain part, but any extra character addition to the domain part is allowed(not properly validated) for example johnson@gmail.com.com.com.com is currently allowed.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://staging.api-python.boilerplate.hng.tech/register'
  2. Enter your details
  3. Add an extra '.com' to the domain part as many times
  4. Click on register
  5. Registration is successful

Expected behavior The server is supposed to respond with "Invalid email" or a message of the same likeness.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

ENTERED johnson@gmail.com.com DURING REGISTRATION bug register

SERVER ALLOWED REGISTRATION bug register allowed invalid email

Additional context The backend should not allow such invalid emails to be registered in the platform