You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 20, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on May 20, 2021. It is now read-only.
Im finding that following the normal react-navigation 'Auth Flow' as per the docs breaks when targetting web - as the url deep linking will bypass that route, and therefore the nested screen is loaded without the auth being inited.
has anyone experienced this - what are you thoughts on how to address this problem?
so I'm currently getting around this using nested AppContainer's. I'm not sure if this is valid as I'm just getting started, but at the top level of my app I have a normal app container:
This seems to work well, even if you visit /Screen2 when not authed you'll see my auth screen. Once logged in /Screen2 will be shown as expected.
The only thing I can't seem to figure out is how to make /Screen my index view and work as /. Visiting / shows the correct view, but I don't know how to get back to that view without it ending up as /Screen in the url bar.
Hello, any news/advice regarding the "Web Auth" flow in web? In my Expo project I'm using a Switch Navigator, however in web, as @tonypee said one can go to the "protected" screens without any type of checks. In my project:
I have tried both ways (with history "hash"). I haven't found a lot of documentation about it. I would like to know how to handle this in the web. Thank you!
Activity
chrisdrackett commentedon Jul 6, 2019
so I'm currently getting around this using nested AppContainer's. I'm not sure if this is valid as I'm just getting started, but at the top level of my app I have a normal app container:
then within
AppI have another:This seems to work well, even if you visit
/Screen2when not authed you'll see my auth screen. Once logged in/Screen2will be shown as expected.The only thing I can't seem to figure out is how to make
/Screenmy index view and work as/. Visiting/shows the correct view, but I don't know how to get back to that view without it ending up as/Screenin the url bar.chrisdrackett commentedon Jul 7, 2019
@tonypee got this working using the following code for
App:chrisdrackett commentedon Sep 8, 2019
So I was able to (almost) get this working without two navigators. The issue I'm running into is that if you open the app with a deep URL that is within
Appit seems that theStartupwill be skipped. I found workarounds for this in a native context: https://stackoverflow.com/questions/54350991/react-navigation-deep-linking-with-authenticationbut I don't feel these work in a web context.
For now I'm going to keep my nested navigators, but I'm curious if there is a way to support auth without having to "break the rules" :)
proof666 commentedon Oct 1, 2019
@chrisdrackett, thank you!
Does some body from react navigation team have recommendations for the 'right' way to accomplish this part of auth flow?
anatula commentedon Nov 6, 2019
Hello, any news/advice regarding the "Web Auth" flow in web? In my Expo project I'm using a Switch Navigator, however in web, as @tonypee said one can go to the "protected" screens without any type of checks. In my project:
And then, my App Container:
I have tried both ways (with history "hash"). I haven't found a lot of documentation about it. I would like to know how to handle this in the web. Thank you!