From e2a39620927c22aff825a85aefa2394e6344154b Mon Sep 17 00:00:00 2001 From: McMatts Date: Tue, 14 May 2019 14:52:36 +0100 Subject: [PATCH] Remove double screen blink after logout --- gui/app/pods/auth/logout/route.js | 2 ++ gui/app/routes/application.js | 4 ++-- gui/app/services/app-meta.js | 2 +- gui/app/templates/components/layout/master-sidebar.hbs | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gui/app/pods/auth/logout/route.js b/gui/app/pods/auth/logout/route.js index eeed9d9c..d655d4a2 100644 --- a/gui/app/pods/auth/logout/route.js +++ b/gui/app/pods/auth/logout/route.js @@ -15,6 +15,8 @@ import Route from '@ember/routing/route'; export default Route.extend({ session: service(), appMeta: service(), + router: service(), + localStorage: service(), activate: function () { this.get('session').invalidate().then(() => { diff --git a/gui/app/routes/application.js b/gui/app/routes/application.js index c85a0883..a2c45e3d 100644 --- a/gui/app/routes/application.js +++ b/gui/app/routes/application.js @@ -25,7 +25,7 @@ export default Route.extend(ApplicationRouteMixin, { let sa = this.get('session.session.authenticator'); - return this.get('appMeta').boot(transition.targetName, window.location.href).then(data => { + return this.get('appMeta').boot(transition.targetName, '').then(data => { if (sa !== "authenticator:documize" && sa !== "authenticator:keycloak" && sa !== "authenticator:ldap" && data.allowAnonymousAccess) { if (!this.get('appMeta.setupMode') && !this.get('appMeta.secureMode')) { return this.get('session').authenticate('authenticator:anonymous', data); @@ -46,7 +46,7 @@ export default Route.extend(ApplicationRouteMixin, { this.get('localStorage').clearSessionItem('entryUrl') if (!_.includes(next, '/auth/')) { - window.location.href= next; + // window.location.href= next; } } }, diff --git a/gui/app/services/app-meta.js b/gui/app/services/app-meta.js index 0c20704d..4cd91174 100644 --- a/gui/app/services/app-meta.js +++ b/gui/app/services/app-meta.js @@ -89,7 +89,7 @@ export default Service.extend({ this.get('localStorage').clearAll(); return resolve(this); - } else if (!_.includes(requestedUrl, '/auth/')) { + } else if (!_.includes(requestedUrl, '/auth/') && !_.isEmpty(requestedUrl)) { this.get('localStorage').storeSessionItem('entryUrl', requestedUrl); } diff --git a/gui/app/templates/components/layout/master-sidebar.hbs b/gui/app/templates/components/layout/master-sidebar.hbs index a6661795..1da0864b 100644 --- a/gui/app/templates/components/layout/master-sidebar.hbs +++ b/gui/app/templates/components/layout/master-sidebar.hbs @@ -99,7 +99,7 @@ Help {{#if enableLogout}}
- {{#link-to "auth.logout" class="item" }}Logout{{/link-to}} + {{#link-to "auth.logout" class="item"}}Logout{{/link-to}} {{/if}} {{/attach-popover}}