Fixes issues reported in PR #69 : enforce mandatory profile completion and navigation guards #70
+2,513
−1,499
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.
Summary
This PR fixes and completes the behavior introduced in PR #69 by enforcing a strict first-time login workflow. Users with incomplete profiles (missing Name or College) are now blocked from accessing the rest of the application until their profile is updated. The PR also resolves authentication race conditions and navigation stability issues discovered during testing of PR #69.
Key Changes
Mandatory Profile Enforcement
Login.jsx): Added a strict post-login check to redirect users with missingnameorcollegeto/profile/edit.Layout.jsx): Implemented a forced redirect mechanism that prevents users with incomplete profiles from navigating to any other route.EditProfile.jsx): Enforced Name and College as mandatory fields and blocked submission if they are empty.UI / UX Enhancements
Bug Fixes & Stability Improvements
AuthContext.js): Fixed an issue where redirects triggered before user data was fully written tolocalStorageby properly awaiting storage updates.api/userInfo.js): Added null-safety checks forlocalStorageaccess to prevent crashes on page refresh.How to Verify
/profile/edit./profile/edit.Fixes issues identified in PR #69.