firebase / firebase/firebase-js-sdk

Firebase login with google much slower than native google login, JWT takes a long time

Open
#2,177 3 comments 2 reactions 1 assignee Claimed by @yuchenshi View on GitHub
api: auth feature request
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Describe your environment

* Operating System version: OSX
* Browser version: chrome 76.0.3809.132
* Firebase SDK version: 6.4.1
* Firebase Product: auth

I've noticed that following the [login with google guide](https://firebase.google.com/docs/auth/web/google-signin) as mentioned in the firebase docs is significantly slower to load the actual google login page than using the [login with google](https://developers.google.com/identity/sign-in/web/sign-in) and then [passing the creds to firebase](https://firebase.google.com/docs/auth/web/google-signin#advanced:-handle-the-sign-in-flow-manually)

![ezgif com-resize](https://user-images.githubusercontent.com/6565602/64943123-892b9f00-d888-11e9-89ff-d38e2edf9fe0.gif)

Notice that the firebase popup shows about:blank for a good 2 seconds.

I've made a minimal reproduction to demonstrate this, (i'm using angular but it doesn't matter)
**[https://itsteknas.github.io/fierbase-login-delay-reproduction/](https://itsteknas.github.io/fierbase-login-delay-reproduction/)**

This bug is for two reasons,

1. The time it takes to load the google login in firebase is too much compared to gauth ~3-4s
2. The time it takes to get the firebase JWT after successful gauth is again too much ~2 s

The problem is only worsened by the poor connectivity while using cellular network.
You can try the demo page with some network throttling and see it for yourself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.