diff --git a/ui/app/routes/loading.js b/ui/app/routes/loading.js index 7457ead32..ad5294e83 100644 --- a/ui/app/routes/loading.js +++ b/ui/app/routes/loading.js @@ -1,25 +1,9 @@ import Route from '@ember/routing/route'; -import { inject as service } from '@ember/service'; export default Route.extend({ - router: service(), - init() { + setupController(controller) { this._super(...arguments); - this.router.on('routeWillChange', (transition) => { - this.set('myTargetRouteName', transition.to.name); - }); - }, - renderTemplate() { - let targetName = this.myTargetRouteName; - let isCallback = - targetName === 'vault.cluster.oidc-callback' || targetName === 'vault.cluster.oidc-callback-namespace'; - if (isCallback) { - this.render('vault/cluster/oidc-callback', { - into: 'application', - outlet: 'main', - }); - } else { - this._super(...arguments); - } + const targetRoute = location.pathname || ''; + controller.set('isCallback', targetRoute.includes('oidc/callback')); }, }); diff --git a/ui/app/routes/vault/cluster/oidc-callback.js b/ui/app/routes/vault/cluster/oidc-callback.js index 964d595a7..c26ac6e55 100644 --- a/ui/app/routes/vault/cluster/oidc-callback.js +++ b/ui/app/routes/vault/cluster/oidc-callback.js @@ -13,10 +13,8 @@ export default Route.extend({ let queryParams = { source, namespace, path, code, state }; window.opener.postMessage(queryParams, window.origin); }, - renderTemplate() { - this.render(this.templateName, { - into: 'application', - outlet: 'main', - }); + setupController(controller) { + this._super(...arguments); + controller.set('pageContainer', document.querySelector('.page-container')); }, }); diff --git a/ui/app/templates/components/oidc-callback-splash.hbs b/ui/app/templates/components/oidc-callback-splash.hbs new file mode 100644 index 000000000..93c94a71e --- /dev/null +++ b/ui/app/templates/components/oidc-callback-splash.hbs @@ -0,0 +1,14 @@ +
+
+
+
+ +
+ +
+
+
\ No newline at end of file diff --git a/ui/app/templates/loading.hbs b/ui/app/templates/loading.hbs index 143f5191c..d7c4be4cf 100644 --- a/ui/app/templates/loading.hbs +++ b/ui/app/templates/loading.hbs @@ -1 +1,5 @@ - \ No newline at end of file +{{#if this.isCallback}} + +{{else}} + +{{/if}} \ No newline at end of file diff --git a/ui/app/templates/vault/cluster/oidc-callback.hbs b/ui/app/templates/vault/cluster/oidc-callback.hbs index 93c94a71e..5bbde76c1 100644 --- a/ui/app/templates/vault/cluster/oidc-callback.hbs +++ b/ui/app/templates/vault/cluster/oidc-callback.hbs @@ -1,14 +1,3 @@ -
-
-
-
- -
- -
-
-
\ No newline at end of file +{{#in-element this.pageContainer}} + +{{/in-element}} \ No newline at end of file diff --git a/ui/lib/core/addon/components/masked-input.js b/ui/lib/core/addon/components/masked-input.js index 77c65f53f..30ea93fec 100644 --- a/ui/lib/core/addon/components/masked-input.js +++ b/ui/lib/core/addon/components/masked-input.js @@ -52,7 +52,9 @@ export default Component.extend({ this.onChange(value); }, handleKeyUp(name, value) { - this.onKeyUp(name, value); + if (this.onKeyUp) { + this.onKeyUp(name, value); + } }, }, });