-
Notifications
You must be signed in to change notification settings - Fork 985
Closed
Description
[REQUIRED] Describe your environment
- Operating System version: MacOS 10.15.3___
- Browser version: __Chrome Version 81.0.4044.138 ___
- Firebase SDK version: 7.13.1
- Firebase Product: _auth (auth, database, storage, etc)
[REQUIRED] Describe the problem
Steps to reproduce:
After calling signInWithRedirect() and then getRedirectResults() on the page load after the login succeeds, the user is always null.
This has been reported before here but was closed.
Relevant Code:
This code runs on page load, but the user is null:
firebase.auth().getRedirectResult().then(credential => {
if (credential.user)
firebase
.database()
.ref('users')
.child(credential.user.uid)
.child('email')
.set('[email protected]');
});
However, in onAuthStateChanged there is a user.
matthewmateo, talves, 1-Felix, NickNish09, yangalli and 12 more