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

'users' collection not found in Firestore after successful Google Authentication #12

Open henrychea opened 2 years ago

henrychea commented 2 years ago

Stuck on the auth hook video where we need to subscribe to the document changes in order to get the username.

Can fixed by manually create a Firestore collection called 'users' and a document with the same uid as the authenticated user.

However, this was not mentioned in any part during the setup of Firebase or before the start of the Authentication part.

EKivutha commented 2 years ago

Hey can you explain this further, the collection should be auto generated n creating your first user.

henrychea commented 2 years ago

Sure, the collection is not auto generated in Firebase. In later parts of the tutorial, it is described and given how to generate said document in the collection. Therefore, I'd just like to mention that the above part of the tutorial should maybe include a footnote or something like "create a dummy document for now and we'll learn how to create an actual document in later videos" or something like that.

matthall1998 commented 1 year ago

Wow.... I just got stuck for an hour on the auth hook video as well. Creating a users collection manually and assigning it my current logged in user fixed the issue. Follow the template below.

Screenshot 2023-02-09 at 9 25 21 PM