Conversation
…and incorporate light and dark
…and incorporate light and dark
…sal deletion on frontend, not implemented on backend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Frontend Auth Integration, Route Completion & UI Consistency
Summary
This PR completes the frontend integration with the authentication system introduced in the backend auth PR, adds missing API route registrations, resolves merge conflicts, and unifies the visual design across all public-facing pages.
Major Changes
1. Token Management & Refresh Flow (
services/api.ts)Rewrote the API client to support the new refresh token system:
localStorageto in-memory variables mirrored tosessionStorage(reduces XSS exposure)POST /api/auth/refresh, replaces both tokens, and retries the original request onceapi.delete()now accepts an optional request body (needed for account deletion)localStoragetoken on first load2. Auth Context (
context/AuthContext.tsx)login()now stores bothtokenandrefreshTokenvia the newsetTokens()helperlogout()is now async: callsPOST /api/auth/logoutwith the refresh token (best-effort server-side revocation), then clears tokens locally3. User Types (
types/user.ts)LoginResponsenow includesrefreshTokenfieldRefreshResponsetype (accessToken+refreshToken)4. Centered Card Layout for All Auth Pages
Replaced the old two-column hero layout with a centered card + gradient orb background on every public auth page for visual consistency:
.tsxand.css.tsxand.css, added live password checklist with check/X icons.tsxand.css.tsxand.css.cssto match centered card layout.tsx(added forgot password link, orb background) and.cssAll pages now share the same visual pattern: dark background, purple/pink gradient orbs, bordered card with FinanceAI logo.
5. Route Fixes (
App.tsx)/reset-passwordfrom insideProtectedRouteto public routes — users arrive from an email link without being logged in6. Missing Backend Route Registrations
Created two new route plugins that were missing — the frontend was calling these endpoints but the backend never registered them:
investments.route.ts—GET /api/investments/holdingsandGET /api/investments/transactions(used by DashboardPage, InvestmentsPage, SavingsPage)liabilities.route.ts—GET /api/liabilities(used by DebtsPage)app.tsto register both with their prefixes7. ProfilePage Updates (
ProfilePage.tsx)api.delete('/api/auth/account', { currentPassword })instead of rawfetch()logout()calls properly awaited (password change + account deletion)8. DashboardPage Fix (
DashboardPage.tsx)entertainment,medical, andemergencyFund9. Test Fix (
DashboardPage.test.tsx)LabelListexport to therechartsmock —BarChart.tsxusesLabelListbut the test mock didn't include itFiles Changed
New Files
Security Notes
sessionStorageinstead oflocalStorage— not accessible across tabs but survives page refresh within a tabTesting
npm run lint— passesnpm run test— passes (after addingLabelListto recharts mock)