Remove console.log. Log onIdTokenChanged error.

This commit is contained in:
James Grugett 2022-08-29 00:26:12 -05:00
parent 71dfcc4dd9
commit ecacce0796

View File

@ -46,8 +46,9 @@ export function AuthProvider(props: {
}, [setAuthUser, serverUser])
useEffect(() => {
return onIdTokenChanged(auth, async (fbUser) => {
console.log('onIdTokenChanged', fbUser)
return onIdTokenChanged(
auth,
async (fbUser) => {
if (fbUser) {
setTokenCookies({
id: await fbUser.getIdToken(),
@ -69,7 +70,11 @@ export function AuthProvider(props: {
setAuthUser(null)
localStorage.removeItem(CACHED_USER_KEY)
}
})
},
(e) => {
console.error(e)
}
)
}, [setAuthUser])
const uid = authUser?.user.id