Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify redirect url for firebase google auth

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?

like image 647
user2248331 Avatar asked Jun 13 '16 23:06

user2248331


People also ask

How do I use Google authentication with Firebase?

In the Firebase console, open the Auth section. On the Sign in method tab, enable the Google sign-in method and click Save.

How do you link authenticated users and databases in Firebase?

//get firebase user FirebaseUser user = FirebaseAuth. getInstance(). getCurrentUser(); //get reference DatabaseReference ref = FirebaseDatabase. getInstance().


1 Answers

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.

like image 85
bojeil Avatar answered Sep 30 '22 04:09

bojeil