diff --git a/web/src/api/Users.ts b/web/src/api/Users.ts index 64c30b16b..db0ceafad 100644 --- a/web/src/api/Users.ts +++ b/web/src/api/Users.ts @@ -5,10 +5,16 @@ let _globalMePromise: Promise; export function me(): Promise { if (!_globalMePromise) { _globalMePromise = new CoreApi(DEFAULT_CONFIG).coreUsersMe().catch((ex) => { + const defaultUser: SessionUser = { + user: { + username: "", + name: "" + } + }; if (ex.status === 401 || ex.status === 403) { window.location.assign("/"); } - return ex; + return defaultUser; }); } return _globalMePromise;