Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation error after authetication #27

Closed
oneil-marcelo opened this issue Jan 7, 2021 · 3 comments
Closed

Navigation error after authetication #27

oneil-marcelo opened this issue Jan 7, 2021 · 3 comments
Labels
invalid This doesn't seem right

Comments

@oneil-marcelo
Copy link

Describe the bug

Hi
After successful authentication, I am receiving the error that follows in the print below.

Thank you for your help.

Screenshots

Screen Shot 2021-01-07 at 15 20 57

To Reproduce

My Navigator component:

const AuthStack: React.FC = () => {
 const { Navigator, Screen } = createStackNavigator();
 return (
   <Navigator>
     <Screen name="signinkeycloak" component={SignInKeycloak} />
   </Navigator>
 );
};

My Keycloack configuration:

<ReactNativeKeycloakProvider
      LoadingComponent={<Text>Loading</Text>}
      authClient={keycloak}
      initOptions={{
        redirectUri: 'myapp://signinkeycloak',
        inAppBrowserOptions: {
          modalPresentationStyle: 'fullScreen',
          enableBarCollapsing: false,
          modalEnabled: true,
          ephemeralWebSession: true,
          dismissButtonStyle: 'ok',
        },
      }}>
      <NavigationContainer linking={linking}>
        <ContextProvider>
          <StatusBar barStyle="dark-content" backgroundColor="#FFF" />
          <Routes />
        </ContextProvider>
      </NavigationContainer>
    </ReactNativeKeycloakProvider>
@IronTony
Copy link
Collaborator

IronTony commented Jan 7, 2021

Hi, that's a problem with your code.
If you read better, it says that "signinkeycloak was not handled by any navigator" .

Moreover check your AuthStack and compare the code with the RN documentation: https://reactnavigation.org/docs/stack-navigator/

@IronTony IronTony added the invalid This doesn't seem right label Jan 7, 2021
@oneil-marcelo
Copy link
Author

Hi @IronTony, Thanks for help.

I used the hook useLinking from react-navigation and It's work perfectly.
https://reactnavigation.org/docs/use-linking

Thanks again.

@joe307bad
Copy link

joe307bad commented Jun 9, 2021

@oneil-marcelo could you expand on your solution? I believe I am running into a similar issue. It seems to be the #state=... portion that is throwing react-navigation off from picking up the link. Testing deeping linking works via CLI: npx uri-scheme open io.act.auth://CreateCheckin --android.

Heres is my linking config:

prefixes: ["io.act.auth://"],
config: {
  screens: {
   CreateCheckin: {
     path: "CreateCheckin"
    }
  }
}

What would be the proper config to match the #state... portion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants