'OTP Verification with Twilio - how to keep user logged in after verification
Using Twilio Verify API to authenticate the user via SMS.
I do not want the user to keep doing the OTP process every time he opens the app - I want to keep him authenticated once he completed the OTP for the first time.
How do I do that - should I generate a token somehow after he logged in?
Appreciate any help.
Solution 1:[1]
Once you have authenticated the user you will want to store something that you can check to see whether they have authenticated. Normally this would be a token of some sort that can be used to access any remote services, but it doesn't have to be.
The answer marked as correct on this question is a good explanation of how to do this, but it should also be noted that storing a token in unencrypted storage is a potential security issue, so you should also pay attention to the highest voted answer with the links to secure storage libraries.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | philnash |