mirror of
https://github.com/documize/community.git
synced 2025-07-20 13:49:42 +02:00
Remove double screen blink after logout
This commit is contained in:
parent
8ecbb9cdee
commit
e2a3962092
4 changed files with 6 additions and 4 deletions
|
@ -15,6 +15,8 @@ import Route from '@ember/routing/route';
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
session: service(),
|
session: service(),
|
||||||
appMeta: service(),
|
appMeta: service(),
|
||||||
|
router: service(),
|
||||||
|
localStorage: service(),
|
||||||
|
|
||||||
activate: function () {
|
activate: function () {
|
||||||
this.get('session').invalidate().then(() => {
|
this.get('session').invalidate().then(() => {
|
||||||
|
|
|
@ -25,7 +25,7 @@ export default Route.extend(ApplicationRouteMixin, {
|
||||||
|
|
||||||
let sa = this.get('session.session.authenticator');
|
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 (sa !== "authenticator:documize" && sa !== "authenticator:keycloak" && sa !== "authenticator:ldap" && data.allowAnonymousAccess) {
|
||||||
if (!this.get('appMeta.setupMode') && !this.get('appMeta.secureMode')) {
|
if (!this.get('appMeta.setupMode') && !this.get('appMeta.secureMode')) {
|
||||||
return this.get('session').authenticate('authenticator:anonymous', data);
|
return this.get('session').authenticate('authenticator:anonymous', data);
|
||||||
|
@ -46,7 +46,7 @@ export default Route.extend(ApplicationRouteMixin, {
|
||||||
this.get('localStorage').clearSessionItem('entryUrl')
|
this.get('localStorage').clearSessionItem('entryUrl')
|
||||||
|
|
||||||
if (!_.includes(next, '/auth/')) {
|
if (!_.includes(next, '/auth/')) {
|
||||||
window.location.href= next;
|
// window.location.href= next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -89,7 +89,7 @@ export default Service.extend({
|
||||||
|
|
||||||
this.get('localStorage').clearAll();
|
this.get('localStorage').clearAll();
|
||||||
return resolve(this);
|
return resolve(this);
|
||||||
} else if (!_.includes(requestedUrl, '/auth/')) {
|
} else if (!_.includes(requestedUrl, '/auth/') && !_.isEmpty(requestedUrl)) {
|
||||||
this.get('localStorage').storeSessionItem('entryUrl', requestedUrl);
|
this.get('localStorage').storeSessionItem('entryUrl', requestedUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
<a href="https://docs.documize.com" target="_blank" class="item">Help</a>
|
<a href="https://docs.documize.com" target="_blank" class="item">Help</a>
|
||||||
{{#if enableLogout}}
|
{{#if enableLogout}}
|
||||||
<div class="divider"></div>
|
<div class="divider"></div>
|
||||||
{{#link-to "auth.logout" class="item" }}Logout{{/link-to}}
|
{{#link-to "auth.logout" class="item"}}Logout{{/link-to}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/attach-popover}}
|
{{/attach-popover}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue