I'm looking for a way to create a basic authentication for my react-native app.
I couldn't find any good example for react-native app.
- To login, the app sends the email/password + clientSecret to my server
- If OK, the server returns accessToken + refreshToken
- The user is logged in, all other requests include the bearer with the accessToken.
- If the accessToken expires, the app requests a new one with the refreshToken automatically.
- The user stays logged in all the time, the states should be saved in the phone.
What would be the best approach for this?
Thanks.