COP4331-LargeGroupProject-Fall22 / backend

Backend for SmartChef project, see https://github.com/COP4331-LargeGroupProject-Fall22/SmartChef
0 stars 1 forks source link

Add: verification pipeline #83

Closed mplekunov closed 1 year ago

mplekunov commented 1 year ago

So here it is, SendGrid email verification.

How it works:

Several new endpoints have been added:

  1. send-verification-code (accepts username, sends verification code to the email provided during registration)
  2. confirm-verification-code (accepts username and code, confirms if provided code is the code that has been sent)

Verification codes are randomly generated and are always within 6 digits. Verification codes last 15 min by default, after that they will be deleted from the memory and client will be required to request verification code again through send-verification-code endpoint.

Behaviors have been updated for Login and Register endpoints.

Login endpoint now checks if account verified or not, if it's not, it returns an error code with appropriate message. Register endpoint now sends verification code on registration of new account.

At this point we don't support change of the email address. Probably will add it in some other PR.

nashirj commented 1 year ago

At this point we don't support change of the email address. Probably will add it in some other PR.

I think if we update the username or email address, it should require reverification. Don't need to add it now, but pls keep in mind if you end up allowing change of email at a later point