Skip to content

[web-console] Fix default tenant not automatically selected on cold start#6548

Merged
Karakatiza666 merged 1 commit into
mainfrom
fix-auth
Jun 28, 2026
Merged

[web-console] Fix default tenant not automatically selected on cold start#6548
Karakatiza666 merged 1 commit into
mainfrom
fix-auth

Conversation

@Karakatiza666

Copy link
Copy Markdown
Contributor

The issue occurs when there is no cached pipeline configuration or already selected tenant when multi-tenant access token is received. The cause was that in this case the UI did not pick the tenant that should be used to authorize the request before making a first authenticated request - fetching the cluster config (await fetchConfigs()).

The fix is moving applyTenantSelection(computeAuthorizedTenants(auth)) right after retrieving the authentication configuration, before any authenticated request is made.

As a side-fix, I clear the selected tenant when the user explicitly logs out (not on e.g. auth expiration), so it doesn't leak after the user logged out.

…tart

Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
@Karakatiza666 Karakatiza666 requested a review from mihaibudiu June 26, 2026 15:39

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tight, well-scoped fix.

The hoist of applyTenantSelection(computeAuthorizedTenants(auth)) out of initializeConfigDependencies and up to right after auth resolution is the correct order: now the tenant is set before the cold-cache fetchConfigs() runs, so the very first authenticated request carries the right tenant header. And clearing the selected tenant on explicit logout (separate from auth expiration) prevents leak across users on a shared browser — also right.

load() runs on every navigation per the doc comment, but applyTenantSelection is idempotent for a stable auth, so calling it eagerly here is harmless.

Doc comment updated to drop the now-obsolete tenant-selection mention. Clean.

LGTM.

@Karakatiza666 Karakatiza666 added this pull request to the merge queue Jun 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 26, 2026
@Karakatiza666 Karakatiza666 added this pull request to the merge queue Jun 28, 2026
Merged via the queue into main with commit e47f0d5 Jun 28, 2026
1 check passed
@Karakatiza666 Karakatiza666 deleted the fix-auth branch June 28, 2026 10:49
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.

3 participants