Skip to content

Fix blank web UI on first load when no password is configured - #200

Open
constkolesnyak wants to merge 1 commit into
ClickHouse:mainfrom
constkolesnyak:fix/web-auth-checking-flag
Open

Fix blank web UI on first load when no password is configured#200
constkolesnyak wants to merge 1 commit into
ClickHouse:mainfrom
constkolesnyak:fix/web-auth-checking-flag

Conversation

@constkolesnyak

Copy link
Copy Markdown
Contributor

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.

checking starts as !getToken(), so it is true for any browser without a stored token, and App.tsx renders null while it is set:

checking: !getToken(),
...
if (checking) return null;

Every branch of checkAuth() clears it — the auth-required path, the success path, the failure path — except the auto-login branch taken when authStatus() reports auth_required: false. That one sets authenticated: true and returns with checking still true, so the app never renders. The reload "fix" works only because a token now exists, which makes checking start false and skips the check entirely.

Fix

Clear checking on that branch too, like every other exit from checkAuth().

Reproduces with auth.password unset and cleared site data; after the change the UI renders immediately on first load.

`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.
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.

1 participant