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 @@ +