import{GoogleButton,GithubButton,useAuthData}from'firebase-react-components'importReactfrom'react'importfirebasefrom'firebase'constApp=()=>{if(!firebase.apps.length){firebase.initializeApp(firebaseConfig)}return(<div><AuthProvidersyncToCookie='FIREBASE_COOKIE'// syncs the user idToken to the cookie FIREBASE_COOKIEsyncToLocalStorage='FIREBASE_TOKEN'// syncs the user idToken to the local storageonLogin={async(user,creds)=>{console.log(creds.toJSON())}}onError={(e)=>alert(e.message)}><GoogleButtontext='Start With Google'// scopes={['https://www.googleapis.com/auth/cloud-platform']}/><GithubButtontext='Start With Github'/><DisplayUser/></AuthProvider></div>)}constDisplayUser=()=>{const{ user={}, loading }=useAuthData()if(loading){return<>loading...</>}return(<pre>{JSON.stringify(user,null,4)}</pre>)}