From 333f8624f1cc1c21e100819d0224c957c4285112 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Thu, 23 May 2019 11:31:34 +0200 Subject: logout user when access token is invalid --- src/stores/GlobalErrorStore.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/stores/GlobalErrorStore.js') diff --git a/src/stores/GlobalErrorStore.js b/src/stores/GlobalErrorStore.js index 90bf751c3..7a85c2daa 100644 --- a/src/stores/GlobalErrorStore.js +++ b/src/stores/GlobalErrorStore.js @@ -18,8 +18,11 @@ export default class GlobalErrorStore extends Store { this.error = request.error; if (request.error.json) { - this.response = await request.error.json(); - + try { + this.response = await request.error.json(); + } catch (error) { + this.response = {}; + } if (this.error.status === 401) { this.actions.user.logout({ serverLogout: true }); } -- cgit v1.2.3-54-g00ecf