We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b3817e commit 590c525Copy full SHA for 590c525
app/services/auth-manager.js
@@ -98,9 +98,16 @@ export default Service.extend({
98
async initialize() {
99
if (this.get('session.isAuthenticated')) {
100
if (this.get('session.data.currentUserFallback.id')) {
101
- const user = await this.store.findRecord('user', this.get('session.data.currentUserFallback.id'));
102
- this.set('currentUserModel', user);
103
- this.identify();
+ try {
+ const user = await this.store.findRecord('user', this.get('session.data.currentUserFallback.id'));
+ this.set('currentUserModel', user);
104
+ this.identify();
105
+ } catch (e) {
106
+ console.warn(e);
107
+ this.session.invalidate();
108
+ this.notify.error(this.l10n.t('An unexpected error has occurred'));
109
+ }
110
+
111
} else {
112
this.identifyStranger();
113
}
0 commit comments