the screens opens from deep link is appearing again

33 Views Asked by At

We have implemented the deeplink for our Android application, its working fine but we have one use case. The user clicks on the Reset Password button, enters the email in the pop up and press the send button for receiving email with OTP. Somehow user kills the app afterwards, opens the deeplink to reset the password, it navigates to the reset password screens. After reseting password, the user login and then logout, now here is the problem instead of navigating to the login screen its navigating again to reset password screen.

the code is follows:

 const config = {
  screens: {
   "reset-password": "reset-password",
  },
 }

 const linking = {
  prefixes: ["https://[ourdomain]/"],
  config,
 }

<NavigationContainer linking={linking} >
   <Stack.Navigator
    initialRouteName='CredentialPage'
    screenOptions={{headerShown: false}}>
    <Stack.Screen name='CredentialPage' component={CredentialPage} />
    <Stack.Screen name='reset-password' component={ResetPassword} />
    other screens ....
</NavigationContainer>
0

There are 0 best solutions below