Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a5e37d3065 |
|
@ -43,10 +43,12 @@ export function AuthProvider(props: {
|
||||||
const cachedUser = localStorage.getItem(CACHED_USER_KEY)
|
const cachedUser = localStorage.getItem(CACHED_USER_KEY)
|
||||||
setAuthUser(cachedUser && JSON.parse(cachedUser))
|
setAuthUser(cachedUser && JSON.parse(cachedUser))
|
||||||
}
|
}
|
||||||
|
console.log('local storage hook')
|
||||||
}, [setAuthUser, serverUser])
|
}, [setAuthUser, serverUser])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return onIdTokenChanged(auth, async (fbUser) => {
|
return onIdTokenChanged(auth, async (fbUser) => {
|
||||||
|
console.log('onIdTokenChanged', fbUser)
|
||||||
if (fbUser) {
|
if (fbUser) {
|
||||||
setTokenCookies({
|
setTokenCookies({
|
||||||
id: await fbUser.getIdToken(),
|
id: await fbUser.getIdToken(),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user