Skip to content

fix(frontend): protect chart routes with auth guard and smart redirect #67

Merged
dazw00110 merged 3 commits intomainfrom
#44-fix-auth-charts
Jan 8, 2026
Merged

fix(frontend): protect chart routes with auth guard and smart redirect #67
dazw00110 merged 3 commits intomainfrom
#44-fix-auth-charts

Conversation

@dazw00110
Copy link
Copy Markdown
Collaborator

  • Added RequireAuth guard to protect routes that require authentication.
  • Implemented a universal notification for unauthorized access attempts.
  • Automatically redirect unauthenticated users to the login page.
  • Preserved the originally requested route and redirected users back after successful login.
  • Added a direct link to the Portfolio on the /me profile page.

Closes #44

…he portfolio view.

Added backend filtering to exclude positions with quantity = 0 from the portfolio view. This prevents "empty" assets from cluttering the list.
- Added a "Guard" (RequireAuth) to protect routes that require authentication.
- Implemented a universal notification: "You must be logged in to access this page" for all protected routes.
- Users trying to access private paths are now automatically redirected to the login page.
- After a successful login, the system automatically redirects the user to their original destination.
- Added a direct link to the Portfolio on the /me profile page.
@dazw00110 dazw00110 self-assigned this Jan 5, 2026
@dazw00110 dazw00110 added bug Something isn't working frontend User interface, dashboards, charts, and client-side state management. labels Jan 5, 2026
@dazw00110 dazw00110 linked an issue Jan 5, 2026 that may be closed by this pull request
Hiltes
Hiltes previously approved these changes Jan 6, 2026
Copy link
Copy Markdown
Collaborator

@Hiltes Hiltes left a comment

Choose a reason for hiding this comment

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

Everything is OK, I dont saw any bugs

Shakalito
Shakalito previously approved these changes Jan 8, 2026
Copy link
Copy Markdown
Owner

@Shakalito Shakalito left a comment

Choose a reason for hiding this comment

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

Router looks good in the final version — no duplicate paths, and RequireAuth cleanly protects /chart/:listingId (and other private routes) with redirect-back behavior.
In future keep PR scope focused .

@dazw00110 dazw00110 dismissed stale reviews from Shakalito and Hiltes via f4a6077 January 8, 2026 16:03
Copy link
Copy Markdown
Owner

@Shakalito Shakalito left a comment

Choose a reason for hiding this comment

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

Everything seems fine

{ path: "/", element: <Navigate to="/me" replace /> },
{ path: "/login", element: <LoginPage /> },
{ path: "/register", element: <RegisterPage /> },
{ path: "/me", element: <MePage /> },
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Let's stay consistent here. Next time reformat the remaining routes to match the new multi-line style before we merge.

@dazw00110 dazw00110 merged commit 5fdd3dc into main Jan 8, 2026
1 check passed
@Shakalito Shakalito deleted the #44-fix-auth-charts branch January 12, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend User interface, dashboards, charts, and client-side state management.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(frontend): protect chart route with authentication

3 participants