Description
Operating System
Windows 10
Environment (if applicable)
Chrome 135 / Node 16 / Web
Firebase SDK Version
11.7.0
Firebase SDK Product(s)
Auth
Project Tooling
React app built with Create React App
Detailed Problem Description
I have an app that is used by a couple of users. Both in development and production, it has suddenly stopped authenticating any user, including me. The last successful login, as showing in the Firebase console, is June 2024. After logging myself, I can't get in again.
The auth is based on the Firebase UI's auth which redirects the user. The only provider used is Google Auth. I know this is not the firebaseui
repo, but just for context, after picking the account and returning to the app, neither signInFailure
nor signInSuccessWithAuthResult
are being called.
Is my issue related to #8329? Should I solve it with https://firebase.google.com/docs/auth/web/redirect-best-practices?
Another cryptic issue is that the getAuth()
object has an internal property called _errorFactory
which is showing this error:
dependent-sdk-initialized-before-auth: "Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."
I am not sure this is a real error (should I ignore it?) because I tried a lot of things to get around this, and nothing worked. I tried:
- Stripping the app down to only the
initializeApp
andgetAuth
calls - Trying using
initializeAuth
- Upgrading to the latest
firebase
package.
Not sure the two issues are connected, but I hope to get rid of this error, if it is a real one.
Steps and code to reproduce issue
import { initializeApp } from "firebase/app"
import { getAuth } from "firebase/auth"
const firebaseConfig = { ... }
const auth = getAuth(app)
console.log(auth)
This shows me the _errorFactory
.
And in another file for firebaseui
login...
new firebaseuiauth.AuthUI(auth).start('#firebaseui-auth-container', {
signInOptions: [
// List of OAuth providers supported.
GoogleAuthProvider.PROVIDER_ID
],
callbacks: {
signInFailure: function(error) {
debugger
},
signInSuccessWithAuthResult: function(authResult, redirectUrl) {
debugger
return false
}
},
})