Well, you need to store the data somewhere. Since you have a stateless API, you probably use JS to communicate with the server. You can store if the user passed in localStorage.
Aug 10, 2020
3
Level 9
Best way to implement an OTP system on a stateless API?
Hello,
I need to integrate an OTP system (One Time Password) to an API using Sanctum.
- The user logins
- He receives an OTP code by SMS or mail
- He fills the code on the app
- Then he can access to his account
But since it's an API, my routes are under the api middleware and not web : I can not use a session.
So, how do I store whether or not my user has passed the OTP step?
I need to save this information in order to authorize or not other requests.
Please or to participate in this conversation.