Skip to content

Commit

Permalink
ui: enable initial data fetch in insecure mode
Browse files Browse the repository at this point in the history
Previously, `alertDataSync`, the function that populates missing cluster info,
did not consider insecure mode when assessing a user's login state.

Because the 23.1 test cluster is running in insecure mode, the UI is noticeably
missing it's cluster ID.

Resolves #102350
Epic: none
Release note: None
  • Loading branch information
zachlite committed Apr 26, 2023
1 parent e22055e commit b64c170
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkg/ui/workspaces/db-console/src/redux/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,15 +653,19 @@ export function alertDataSync(store: Store<AdminUIState>) {
// Always refresh health.
dispatch(refreshHealth());

const { Insecure } = getDataFromServer();
// We should not send out requests to the endpoints below if
// the user has not successfully logged in since the requests
// will always return with a 401 error.
if (
!state.login ||
!state.login.loggedInUser ||
state.login.loggedInUser == ``
) {
return;
// Insecure mode is an exception, where login state is irrelevant.
if (!Insecure) {
if (
!state.login ||
!state.login.loggedInUser ||
state.login.loggedInUser == ``
) {
return;
}
}

// Load persistent settings which have not yet been loaded.
Expand Down

0 comments on commit b64c170

Please sign in to comment.