mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Merge pull request #6822 from kevinansfield/fix-load-with-invalidated-session
Fix initial loading of a route with an invalid session
This commit is contained in:
commit
a20086a864
1 changed files with 11 additions and 3 deletions
|
@ -32,6 +32,7 @@ export default Route.extend(ApplicationRouteMixin, ShortcutsRoute, {
|
|||
this._super(...arguments);
|
||||
|
||||
if (this.get('session.isAuthenticated')) {
|
||||
this.set('appLoadTransition', transition);
|
||||
transition.send('loadServerNotifications');
|
||||
|
||||
// return the feature loading promise so that we block until settings
|
||||
|
@ -59,9 +60,15 @@ export default Route.extend(ApplicationRouteMixin, ShortcutsRoute, {
|
|||
},
|
||||
|
||||
sessionInvalidated() {
|
||||
let transition = this.get('appLoadTransition');
|
||||
|
||||
if (transition) {
|
||||
transition.send('authorizationFailed');
|
||||
} else {
|
||||
run.scheduleOnce('routerTransitions', this, function () {
|
||||
this.send('authorizationFailed');
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
@ -82,6 +89,7 @@ export default Route.extend(ApplicationRouteMixin, ShortcutsRoute, {
|
|||
},
|
||||
|
||||
didTransition() {
|
||||
this.set('appLoadTransition', null);
|
||||
this.send('closeMenus');
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue