bos21001 / familiasm-api

MIT License
0 stars 0 forks source link

[FEAT] Create a Verify Email view #2

Closed bos21001 closed 1 year ago

bos21001 commented 1 year ago

Process Flow

  1. Add your web app email verification redirect page url e.g. http://myapp.com/email/verify to the allowed-verify-email-urls array of the appSection-authentication config.
  2. Send the email verification url to the user by calling the /email/verification-notification endpoint using your web app and pass one of the valid urls that you added in step 1 into the verification_url field of the endpoint.
  3. An email verification link will be sent to the user's email which looks like this: http://myapp.test/email/verify?url=http://api.myapi.test/v1/email/verify/XbPW7awNkzl83LD6/eaabd911e2e07ede6456d3bd5725c6d4a5c2dc0b?expires=1646913047&signature=232702865b8353c445b39c50397e66db33c74df80e3db5a7c0d46ef94c8ab6a9
  4. When the user click the link, he/she will be redirected to the url you specified before, in this case http://myapp.com/email/verify with the url query string
  5. url is the complete url your web app needs to call to verify the user. So you just call this url and the user will be verified.
  6. At this point you should get a 200 OK response and the user's email is verified.
bos21001 commented 1 year ago

I created a ReactJS app to handle this email verification. This first commit already comes with this feature.

repo link: familiasm-web