How to only show currently signed in user data

I’m setting up a MERN stack app and using Firebase for authentication.
It’s basically a note taking app.
How can I associate the notes taken with the user that created that note so that only that user account can view that note?
Currently any user can view all of the notes created by other users.

The notes are stored in FB? Can’t you store their user id with the note? Ideally when they request their notes, they should only get back their notes.

The notes are stored in MongoDB, I’m just using FB for authentication.

OK, and when you get the notes, are you getting every note or just the ones associated with that user?

MongoDB Atlas to be specific.

I’m getting every note.
I would like to only get back the notes associated with the signed in user.

OK… so write an endpoint that does that. You should be able to pass the username (or id or whatever) and only return those. In fact, I would expect them to be organized that way - I can’t think of a reason to have them all mixed together.

Okay, I will try that today and update you . Thank you!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.