From 1fa8b1f4cf343ad709d4a84ea921d03461259ffd Mon Sep 17 00:00:00 2001 From: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> Date: Mon, 13 May 2024 12:07:29 -0500 Subject: [PATCH] UI: remove stored token if cluster needs init (#26985) --- changelog/26985.txt | 3 +++ ui/app/routes/vault/cluster.js | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 changelog/26985.txt diff --git a/changelog/26985.txt b/changelog/26985.txt new file mode 100644 index 0000000000..7894bd3d40 --- /dev/null +++ b/changelog/26985.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Prevent perpetual loading screen when Vault needs initialization +``` diff --git a/ui/app/routes/vault/cluster.js b/ui/app/routes/vault/cluster.js index 6620b04472..74fc23cc52 100644 --- a/ui/app/routes/vault/cluster.js +++ b/ui/app/routes/vault/cluster.js @@ -123,6 +123,10 @@ export default Route.extend(ModelBoundaryRoute, ClusterRoute, { afterModel(model, transition) { this._super(...arguments); this.currentCluster.setCluster(model); + if (model.needsInit && this.auth.currentToken) { + // clear token to prevent infinite load state + this.auth.deleteCurrentToken(); + } // Check that namespaces is enabled and if not, // clear the namespace by transition to this route w/o it