mardi 22 décembre 2020

Creating a signup system with multiple requests / steps

I'm developing a web application that has user interaction and I am currently struggling a bit to understand how to create a signup system which involves multiple requests / communication between the front-end and back-end.

Basic the signup flow goes like this:

  1. User inputs a code into Front-end
  2. Back-end receives this code, verifies it, does some processing and generates a captcha image.
  3. Captcha is presented to the user and they must type in the characters that appear on the captcha image and send it.
  4. Back-end receives that and does some other processing (which includes DB operations for example).
  5. User now register their password of choice.
  6. Backend receives their password, inserts User into DB and done. The user is now registered.

What I'm struggling with is that there's a flow/chain of communication events between Front-end and Back-end and I'm not sure how to tie them up. Should I use a cookie? For example generate a JWT and send it in step (2) and ask for it in every step from that on? Do I need store anything in the database? How do I know user didn't skip any steps (for example by getting the cookie received in step 2 and manually issuing a request on a future step).

I'm not sure this accounts for anything, but the Front-end is being done using React and Back-end is being done using Go with Gin for the router

Looking forward for your clarifications and ideas! Thanks!




Aucun commentaire:

Enregistrer un commentaire