diff --git a/app/routes/application.js b/app/routes/application.js index e35ea21df1d..0d8a7320e5e 100644 --- a/app/routes/application.js +++ b/app/routes/application.js @@ -28,18 +28,24 @@ export default Route.extend(ApplicationRouteMixin, { async model() { let notifications = []; if (this.get('session.isAuthenticated')) { - notifications = await this.authManager.currentUser.query('notifications', { - filter: [ - { - name : 'is-read', - op : 'eq', - val : false - } - ], - sort: '-received-at' - }); + try { + notifications = await this.authManager.currentUser.query('notifications', { + filter: [ + { + name : 'is-read', + op : 'eq', + val : false + } + ], + sort: '-received-at' + }); + } catch (e) { + console.warn(e); + this.session.invalidate(); + } } + return { notifications, pages: await this.store.query('page', {