diff options
author | Dominik Guzei <dominik.guzei@gmail.com> | 2019-05-23 11:31:34 +0200 |
---|---|---|
committer | Dominik Guzei <dominik.guzei@gmail.com> | 2019-05-23 11:31:34 +0200 |
commit | 333f8624f1cc1c21e100819d0224c957c4285112 (patch) | |
tree | 57df290e934ca3674dc81bb65cd9a728d34e27ca /src/stores/GlobalErrorStore.js | |
parent | Merge pull request #1425 from meetfranz/fix/workspace-services-ordering-bug (diff) | |
download | ferdium-app-333f8624f1cc1c21e100819d0224c957c4285112.tar.gz ferdium-app-333f8624f1cc1c21e100819d0224c957c4285112.tar.zst ferdium-app-333f8624f1cc1c21e100819d0224c957c4285112.zip |
logout user when access token is invalid
Diffstat (limited to 'src/stores/GlobalErrorStore.js')
-rw-r--r-- | src/stores/GlobalErrorStore.js | 7 |
1 files changed, 5 insertions, 2 deletions
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 { | |||
18 | this.error = request.error; | 18 | this.error = request.error; |
19 | 19 | ||
20 | if (request.error.json) { | 20 | if (request.error.json) { |
21 | this.response = await request.error.json(); | 21 | try { |
22 | 22 | this.response = await request.error.json(); | |
23 | } catch (error) { | ||
24 | this.response = {}; | ||
25 | } | ||
23 | if (this.error.status === 401) { | 26 | if (this.error.status === 401) { |
24 | this.actions.user.logout({ serverLogout: true }); | 27 | this.actions.user.logout({ serverLogout: true }); |
25 | } | 28 | } |