fireship-io / next-firebase-course

Next.js + Firebase - The Full Course
next-firebase-course-git-main.fireship.vercel.app
477 stars 218 forks source link

Logging out while on a Post page causes an error in HeartButton component #24

Open justisCrocker opened 2 years ago

justisCrocker commented 2 years ago

The following error occurs when clicking Log Out on a post page ([username]/[slug]).

image

It seems that the AuthCheck fails and the HeartButton component is mounted. This shouldn't happen since the HeartButton code requires a logged in user. How can we ensure the AuthCheck works correctly to prevent this?