Fix blank web UI on first load when no password is configured - #200
Open
constkolesnyak wants to merge 1 commit into
Open
Fix blank web UI on first load when no password is configured#200constkolesnyak wants to merge 1 commit into
constkolesnyak wants to merge 1 commit into
Conversation
`checking` starts true whenever there is no stored token, and App renders null while it is true. Every branch of checkAuth() clears it except the auto-login one taken when the server reports auth_required: false — so on a deployment with no password configured, a fresh browser logs in and then sits on a blank page until a manual reload seeds a token and skips the check entirely.
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.
On a deployment with no password configured, a fresh browser loads the web UI, auto-logs in, and then sits on a blank page. A manual reload fixes it, which makes it look like a flaky first paint rather than a state bug.
checkingstarts as!getToken(), so it istruefor any browser without a stored token, andApp.tsxrendersnullwhile it is set:Every branch of
checkAuth()clears it — the auth-required path, the success path, the failure path — except the auto-login branch taken whenauthStatus()reportsauth_required: false. That one setsauthenticated: trueand returns withcheckingstilltrue, so the app never renders. The reload "fix" works only because a token now exists, which makescheckingstartfalseand skips the check entirely.Fix
Clear
checkingon that branch too, like every other exit fromcheckAuth().Reproduces with
auth.passwordunset and cleared site data; after the change the UI renders immediately on first load.