fix: wait for auth session before redirecting - #40
Merged
Conversation
AshanEason
marked this pull request as ready for review
July 18, 2026 07:59
ilsao
approved these changes
Jul 19, 2026
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.
Type of changes
Purpose
/loginwhile the initial session request is still loading.Additional Information
Root Cause
RequireAuthtreated the initialisAuthenticated: falsevalue as a confirmed unauthenticated state before the asynchronous session query had completed. This caused an authenticated user to be redirected to/loginduring application startup.Changes
isLoadingto finish before redirecting an unauthenticated user./login.Difference from #39
src/shared/auth/RequireAuth.tsxonly#40 intentionally excludes:
.env.development,example.env, and README changes.Validation
git diff --checkpnpm formatpnpm typecheckpnpm lintpnpm buildPreview Smoke Test
/redirects to/login.Follow-up and Merge Order
mainfirst.main, address its feature-flag readiness behavior, rerun its checks, and merge it only after its own review.mainand document overrides using.env.development.local.The repository currently has no automated auth regression-test setup, so this PR keeps the hotfix focused and records the manual verification requirement above.