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 Model #7

Open
HarshGurnani opened this issue Jan 14, 2025 · 0 comments · May be fixed by #11
Open

User Model #7

HarshGurnani opened this issue Jan 14, 2025 · 0 comments · May be fixed by #11
Assignees

Comments

@HarshGurnani
Copy link
Collaborator

Task

  • 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

Resources

@JordanJunaidi JordanJunaidi linked a pull request Feb 4, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants