I'm putting a react web app together with firebase.
I have a sign in screen for users to signin with Google using firebase's signInWithRedirect.
It all works fine, except that the auth returns to the signin screen which shows again for a couple of seconds before my react router picks up that they've authenticated and sends them to the app home.
Refreshing the app home is nice and fast.
Signin is on / The app home is on /app
Is there a way to specify that the Google auth for firebase's signInWithRedirect redirects back to the app home rather than to the original signin page?
In the Firebase console, open the Auth section. On the Sign in method tab, enable the Google sign-in method and click Save.
//get firebase user FirebaseUser user = FirebaseAuth. getInstance(). getCurrentUser(); //get reference DatabaseReference ref = FirebaseDatabase. getInstance().
signInWithRedirect always redirects to the same page. You have to call getRedirectResult and then redirect to your app on login. We will relay you request for the custom redirect url to the relevant parties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With