[web-console] Fix default tenant not automatically selected on cold start#6548
Merged
Conversation
…tart Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
mythical-fred
approved these changes
Jun 26, 2026
mythical-fred
left a comment
There was a problem hiding this comment.
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.
mihaibudiu
approved these changes
Jun 26, 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.
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.