Please provide the following:
- SDK Version: 36
- Platforms(Android/iOS/web/all): IOS
I have problem retrieving my authentication token from SecureStore while I develop my app in the expo client.
I’m trying to implement this authentication flow from react navigation using secureStore instead of Async storage: https://reactnavigation.org/docs/en/4.x/auth-flow.html
Currently, when I login my token is stored in SecureStore. I know this because I can then use it for authorising my requests.
My problem is when the expo app refreshes, the token seems to disappear so I have to sign in again.
Does the expo client app refreshing clear the token or is there a bug in my code:
componentDidMount() {
this._bootstrapAsync();
}
_bootstrapAsync = () => {
SecureStore.getItemAsync("token").then(token => {
this.props.navigation.navigate(token ? "App" : "Auth");
});
};