Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user in useAuthState return undefined on refresh #313

Open
Progressive-Programmer opened this issue Oct 12, 2023 · 0 comments
Open

user in useAuthState return undefined on refresh #313

Progressive-Programmer opened this issue Oct 12, 2023 · 0 comments

Comments

@Progressive-Programmer
Copy link

"firebase": "^10.3.1",
"next": "13.4.13",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-firebase-hooks": "^5.1.1",

The user is signed in using useSignInWithGoogle

const [signInWithGoogle, loading, error] = useSignInWithGoogle(auth);

Here's the sample code

` const [user, loading, error] = useAuthState(auth);
const router = useRouter()

useEffect(()=>{
if (!user){
console.log(user)
router.push('/login')
}
},[user])

if (loading) {

}
return (
children
)`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant