- Notifications
You must be signed in to change notification settings - Fork276
Open
Description
snippets-web/snippets/auth-next/index/auth_state_listener.js
Lines 8 to 21 in467eaa1
| import{getAuth,onAuthStateChanged}from"firebase/auth"; | |
| constauth=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 | |
| constuid=user.uid; | |
| // ... | |
| }else{ | |
| // User is signed out | |
| // ... | |
| } | |
| }); |
Metadata
Metadata
Assignees
Labels
No labels