During Email/Phone Verification
Last updated
Last updated
Cotter's email/phone number verification is generally used to check if the email or phone number is active. For websites with no companion app, it is also used as the main method of login.
Cotter can return OAuth tokens when the user's email/phone numbers are verified, and the authentication_method
will be set as OTP
.
In the React Native SDK, you would follow this guide to When the user's email or phone number is successfully verified,
To also receive OAuth Tokens, modify your code by adding getOAuthToken = true
in the parameters:
The response OnSuccess
will be:
Cotter's React Native SDK automatically store your tokens securely inside the device's secure storage.
You need to pass the access_token
to your backend server on every API calls. You also need to remove the tokens from storage to log out your users. Check out how to do that here:
Access tokens and ID tokens expires in 1 hour. When they're expired, you need to use the refresh_token
to get new tokens. Check out how to renew expired tokens:
Using the , you would follow this guide to When the user's email or phone number is successfully verified,
Tokens must be stored securely within your application Use for Android and for iOS apps.