Sets a callback function to be called when the authentication state changes, i.e. when a user signs in or out.
The callback function to be called when the authentication state changes.
onAuthStateChange(async (user) => { if (user) { console.log("User signed in:", user.userId); } else { console.log("User signed out"); }}); Copy
onAuthStateChange(async (user) => { if (user) { console.log("User signed in:", user.userId); } else { console.log("User signed out"); }});
Sets a callback function to be called when the authentication state changes, i.e. when a user signs in or out.