You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a users model in our database to represent the users of our application.
Fields a user model should have
Name
Email
UID (a string that should be the user's unique ID in Firebase. This allows us to associate a Firebase token/user with a user in our DB)
In local MongoDB database, create a user for testing using the PAP dev email account (credentials in .env file)
Create an API route /api/whoami that should ensure the user is authenticated and should return information about their corresponding record in our DB. Use the Firebase Admin API to validate the Firebase JWT token in the request header, and use that token to retrieve the user UID from firebase. Then, find the user in our DB with that UID, and send that user's UID, role, and ID in the response. If that UID is not found in our DB, return an error message saying the user does not exist.
Did something veryyy similar for PAP - look at that codebase
Task
Resources
The text was updated successfully, but these errors were encountered: