Backend: Handling Response
Register or Login your user to your Database
When the user is authenticated, you will receive a response similar to this from your front end. Your frontend is reponsible for sending this payload to your server.
Send this payload to your backend to register or login the user in your database. A typical flow would look like this:
Validate the access token
Check if the email exists in your database
If it doesn't exists: Create a new user
If it exists: Continue login
(Optional) If you want to use your own session tokens, set the cookie here after validating the access token.
(Optional) if you want to use Cotter's tokens, either store Cotter's access token in the cookie or on the front-end side.
Examples:
Validating Cotter's Access Token
Read more on how to verify the OAuth Tokens from Cotter here:
Last updated