Firebase onAuthStateChanged()
is returning user credentials in Chrome, but not in Firefox:
What is the likely reason(s) for this?
Update: Here is the minimum code needed to reproduce the issue:
var firebase = require("firebase/app"),
C = require("./constants.js");
require("firebase/auth");
firebase.initializeApp(C.FIREBASE_CONFIG);
firebase.auth().onAuthStateChanged(function(user) {
console.log('user is ' + user);
})
I have a lot more code in my app but after stripping everything out, this is the only code running and the issue still occurs:
Firebase Authentication integrates tightly with other Firebase services, and it leverages industry standards like OAuth 2.0 and OpenID Connect, so it can be easily integrated with your custom backend.
Prices are per successful verification. On the Blaze plan, Phone Authentication provides a no-cost tier. The first 10K verifications for both instances (USA, Canada, and India and All other countries) are provided at no cost each month. You are only charged on usage past this no-cost allotment.
Perhaps you have enabled Enhanced Tracking Protection in your Firefox.
It needs to be disabled for the site or globally for Firebase Authentication to work. If Enhanced Tracking Protection is enabled, onAuthStateChanged
is called with null
, even when you authenticated successfully.
See Firefox documentation for configuration: https://support.mozilla.org/en-US/kb/enhanced-tracking-protection-firefox-desktop
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