Skip to content

fix: dashboard reload redirect - #121

Merged
Alaa2019-ml merged 2 commits into
developfrom
fix/dashboard-redirect
Feb 28, 2026
Merged

Alaa2019-ml merged 2 commits into
developfrom
fix/dashboard-redirect

Conversation

@Dmytro-Doronin

@Dmytro-Doronin Dmytro-Doronin commented Feb 27, 2026 •

Copy link
Copy Markdown
Collaborator

Fixed private pages redirect after reload and added AuthIndicator to the mobile menu

Copilot AI review requested due to automatic review settings February 27, 2026 19:12
@HackYourFutures
HackYourFutures temporarily deployed to study-bridge-fix-dashbo-prjsdv February 27, 2026 19:13 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the client’s auth/role route guards to avoid incorrect redirects during session rehydration after a reload, and updates the mobile menu to show an authenticated user indicator.

Changes:

  • Add auth initialization/loading handling to RequireAuth and RequireRole using authInitDone (and accessToken) to delay redirects until session bootstrap completes.
  • Add a reusable ModalOverlay component and use it for full-screen loading states in RequireRole.
  • Update the mobile menu to show ProfileIndicator when authenticated and adjust auth detection to include accessToken.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
client/src/router/RoleIndexRedirect.tsx Adds redirect state preservation when user is missing (currently introduces a build error).
client/src/router/RequireRole.tsx Adds auth bootstrap/loading gating and full-screen loader overlay before role checks/redirects.
client/src/router/RequireAuth.tsx Switches guard loading logic to use authInitDone and preserves redirect from state.
client/src/features/auth/query/useMeQuery.tsx Minor formatting cleanup.
client/src/components/ui/modal/ModalOverlay.tsx Introduces a simple full-screen overlay wrapper for loading/modals.
client/src/components/ui/mobileMenu/MobileMenu.tsx Shows ProfileIndicator when authenticated; updates auth detection to include access token.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/src/router/RoleIndexRedirect.tsx
Comment thread client/src/router/RequireAuth.tsx Outdated
Comment thread client/src/router/RequireRole.tsx Outdated
Comment thread client/src/router/RequireRole.tsx Outdated
@HackYourFutures
HackYourFutures temporarily deployed to study-bridge-fix-dashbo-prjsdv February 27, 2026 19:25 Inactive
@Alaa2019-ml
Alaa2019-ml merged commit a740a3b into develop Feb 28, 2026
2 checks passed

This branch was previously deployed

1 inactive deployment
study-bridge-fix-dashbo-prjsdv — a1c098a1 Deployed Feb 27, 2026 by HackYourFutures
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.

4 participants