I want to set up an authentication system with Google using @react-native-google-signin/google-signin.
The login works well with the authorization prompt.
My problem is that if the token has expired or been revoked by the user, the application continues to authenticate the user with the token stored in AsyncStorage.
So, what I want to do is verify if the token is valid or not. If it is valid, we use it to authenticate the user when the application starts; if not, we log the user out.
I tried using Axios to refetch the token, but it didn’t work.
I also tried with Firebase Auth import auth, {firebase} from ‘@react-native-firebase/auth’, but that didn’t work either, and I’m not sure if it’s the right approach.
Mampionona is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.