-
Notifications
You must be signed in to change notification settings - Fork 275
Open
Description
snippets-web/snippets/auth-next/index/auth_state_listener.js
Lines 8 to 21 in 467eaa1
import { getAuth, onAuthStateChanged } from "firebase/auth"; | |
const auth = getAuth(); | |
onAuthStateChanged(auth, (user) => { | |
if (user) { | |
// User is signed in, see docs for a list of available properties | |
// https://firebase.google.com/docs/reference/js/auth.user | |
const uid = user.uid; | |
// ... | |
} else { | |
// User is signed out | |
// ... | |
} | |
}); |
Metadata
Metadata
Assignees
Labels
No labels