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

Feat/samvritsrinath firebase auth #18

Merged
merged 34 commits into from
Feb 20, 2024

Conversation

HarshGurnani
Copy link
Contributor

@HarshGurnani HarshGurnani commented Feb 11, 2024

Tracking Info

Resolves #8

Changes

  • Set up firebase admin for backend usage and user mongo model with role and uid fields
  • Created login page on frontend following Figma Design; rendered at /login
  • Created backend route at /api/whoami that uses the sender's JWT token to verify identity, and returns the user's role and uid if that user exists in the database; this route is called upon hitting the login button on the frontend

Testing

We added console statements that printed out the user information received from the backend, which we took a screenshot of in the Javascript console. Furthermore, a dummy page was set up that the login page routed to after the call to the backend was resolved. The page was also checked on a mobile device

Confirmation of Change

Screenshot 2024-02-10 at 4 32 10 PM

Login page on laptop

Screenshot 2024-02-04 at 11 10 17 AM

User information printed to console

Screenshot 2024-02-04 at 11 10 48 AM

Rerouted to dummy page

Copy link
Collaborator

@benjaminJohnson2204 benjaminJohnson2204 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I left a few minor comments but overall great job

backend/.env.example Show resolved Hide resolved
backend/src/routes/users.ts Outdated Show resolved Hide resolved
backend/src/routes/users.ts Outdated Show resolved Hide resolved
frontend/.env.example Show resolved Hide resolved
frontend/src/app/page_cp.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@benjaminJohnson2204 benjaminJohnson2204 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more very minor comments

backend/src/middleware/auth.ts Outdated Show resolved Hide resolved
backend/src/middleware/auth.ts Outdated Show resolved Hide resolved
frontend/src/app/login/page.tsx Outdated Show resolved Hide resolved
frontend/src/app/page.tsx Outdated Show resolved Hide resolved
frontend/src/app/page.tsx Outdated Show resolved Hide resolved
Copy link
Collaborator

@benjaminJohnson2204 benjaminJohnson2204 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for addressing my comments!

Copy link
Contributor

@Syu125 Syu125 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - the dummy page showed up after login, and I can see the firebase errors when the login info is not in the database.

Copy link
Contributor

@yotzkim yotzkim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@benjaminJohnson2204 benjaminJohnson2204 merged commit c60b6b4 into main Feb 20, 2024
4 checks passed
@benjaminJohnson2204 benjaminJohnson2204 deleted the feat/samvritsrinath-firebase_auth branch February 20, 2024 23:36
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 this pull request may close these issues.

Authentication
5 participants