Skip to content

Commit

Permalink
Remove double screen blink after logout
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmatts committed May 14, 2019
1 parent 8ecbb9c commit e2a3962
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions gui/app/pods/auth/logout/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
4 changes: 2 additions & 2 deletions gui/app/routes/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion gui/app/services/app-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion gui/app/templates/components/layout/master-sidebar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<a href="https://docs.documize.com" target="_blank" class="item">Help</a>
{{#if enableLogout}}
<div class="divider"></div>
{{#link-to "auth.logout" class="item" }}Logout{{/link-to}}
{{#link-to "auth.logout" class="item"}}Logout{{/link-to}}
{{/if}}
</div>
{{/attach-popover}}
Expand Down

0 comments on commit e2a3962

Please sign in to comment.