Conversation
nakazawak
left a comment
There was a problem hiding this comment.
Everything lgtm, hopefully nothing breaks lol🤞
There was a problem hiding this comment.
When running the frontend on this branch, I hit Missing environment variables: NEXT_PUBLIC_FIREBASE. I couldn’t find setup instructions or a .env.example in the repo. After I receive the env variable I will test the log in and follw up on whether everything is good.
nakazawak
left a comment
There was a problem hiding this comment.
Okay I just tested it out and the logic seems to be working as described in the documentation. Looks fire.
navyaa31
left a comment
There was a problem hiding this comment.
Looks great! Great job on the responsive design.
I used Michael's email and the pw test1234 to log in, but can we change it to the home start email so that everyone can log in and test the reset feature?
Also, could you create a middleware.ts so that an unauthenticated user isn't able to access any other routes, and redirect them to the log in page
|
Just updated the login details to user: tsehomestart@gmail.com and password: homestart999 |
CharlieSuarezRobles
left a comment
There was a problem hiding this comment.
Everything seems fine to me. There's just a small bug regarding the eye functionality in the login. You can see it in the comment down below.
…es firebase admin on startup and provide middleware to proect routes
Changes
Authorization
backend/src/firebase/admin.ts: Initializes Firebase Admin SDK using service account from environment variablebackend/src/middleware/auth.ts: Exports verifyToken middleware function, extracts Bearer token from Authorization header, verifies token using Firebase Admin auth.verifyIdToken(), attaches user info (uid, email) to request object.backend/src/app.ts: Added express.json() middleware, imported Firebase admin, and added example public route and protected route.frontend/src/middleware.tsTesting
For testing, use email: tsehomestart@gmail.com and password: homestart999
Screenshot below confirms authentication works (successful login currently redirects to home page)
updated UI screenshots of correct password and invalid password:
Testing
To test middleware, login after being redirected to the login page, at which point you should be able to view other routes like "/". You can test again on an incognito tab.
Todo