This blog post is a complimentary resource to support the video on Expo Router v2
In the video, I walk you through the code for an authentication ...
For further actions, you may consider blocking this person and/or reporting abuse
I think I'm missing something as when I have a user it falls through to a [...missing] page.
Here I think is my issue as there is a missing edge case in:
if (
// If the user is not signed in and the initial segment is not anything in the auth group.
!user &&
!inAuthGroup
) {
// Redirect to the sign-in page.
router.push("/sign-in");
} else if (user && inAuthGroup) {
// Redirect away from the sign-in page.
router.push("/");
}
Potentially missing...
if (user && !inAuthGroup) { ...
Everything else works perfectly. Just trying to figure out where I went wrong.
do you have a simple project somewhere i could take a look at?
Yes, sure - where do I share it?
You can DM me on Twitter if you don’t want to post link to project here
Wouldn't let me DM so dropped you an email hope you don't mind. Have a great day man!
i dont see an email?
HYG, github.com/davidlintin/expo-router... here are all the Authentication files let me know if you need more.
this is not a project :-(
Ah sorry, finally figured out GitHub :) [(github.com/davidlintin/expo-router...]
Saved my day!!! Post upgrading to SDK 49 and router v2 I was struggling with authentication issues!! Thank you for the wonderful solution.
Thank you for this tutotial. I tried this solution and replaced it with firebase-auth but I am getting an unmatched route on app load, Been on this for some days, Pls can you help take a look?
do you have a sample project i can take a look at?