srighankittu / GradGrove

0 stars 0 forks source link

Login and Sign Up for Student #5

Open srighankittu opened 1 month ago

srighankittu commented 1 month ago

Once you click on start the adventure now, you should navigate to this page

Screenshot 2024-08-22 at 6 06 43 PM

And based on what the person clicks, he needs to to be navigated to a signup form. It should be a basic signup form. For Students, it must include the following fields:

  1. Name
  2. Date of birth
  3. Age (Should be read only and be autogenerated based on date of birth)
  4. Gender (Dropdown with all genders that will be fetched from backend)
  5. Field of Study
  6. Phone (Verify using OTP)
  7. Email
  8. Password

All these fields should be properly validated using regex or Yup(library)

Once Sign up is done, the details will be stored in a users collection in Mongo DB.

Note: The raw password value should NOT be sent to backend. So in when anyone checks the network tab he should see some hashed value and not the actual password. After Sign up it should return a token(but should not log in).

Now user logs in(even in this case raw password should not be sent) as a student using email and password and get another token and then log in. After logging in, in all the subsequent features we will have to send this token to backend to verify the user and in the backend we will use a middleware to verify if it's a valid token or not. Ideally there will be no expiry to the token but the user stays idle for 10 mins then the token will expire(figure it out)

srighankittu commented 1 month ago

Please use cookie storage