fix: dashboard reload redirect - #121
Merged
Merged
Conversation
HackYourFutures
temporarily deployed
to
study-bridge-fix-dashbo-prjsdv
February 27, 2026 19:13
Inactive
Contributor
There was a problem hiding this comment.
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
RequireAuthandRequireRoleusingauthInitDone(andaccessToken) to delay redirects until session bootstrap completes. - Add a reusable
ModalOverlaycomponent and use it for full-screen loading states inRequireRole. - Update the mobile menu to show
ProfileIndicatorwhen authenticated and adjust auth detection to includeaccessToken.
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.
HackYourFutures
temporarily deployed
to
study-bridge-fix-dashbo-prjsdv
February 27, 2026 19:25
Inactive
Alaa2019-ml
approved these changes
Feb 27, 2026
This branch was previously deployed
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.
Fixed private pages redirect after reload and added AuthIndicator to the mobile menu