Project with front-end and back-end separation
Now in the project, verification codes and text messages need to be sent for some verification
The problem is that there are several pages now that have these verifications. For example, you can send text messages to log in, and you also need to send them to register. SMS;
Registration requires a verification code, and other pages may also send verification codes;
The problem is that if the user logs in on two PCs at the same time, Then I applied for text messages on both PC-A and PC-B. At this time, after the user enters the text message, how should I judge which text message should be verified with which text message on the backend?
The same is true for the verification code. How to judge whether the user has sent the text message? Which verification code should the incoming verification code be verified with from the backend?
The same account should limit the verification code to only be sent once within the expiration period. Ask your backend to change the logic
Save verification code through session or cookie
Every device is different
1. The last verification code is valid, and subsequent ones will overwrite the original one.