diff options
author | anonymous | 2022-09-21 12:46:08 -0400 |
---|---|---|
committer | anonymous | 2022-09-21 12:46:08 -0400 |
commit | 8ca207d31ef3eb9c3102f7fdb23f85b53d16924f (patch) | |
tree | d98a6c6b836f6c7f0f82ca459514faa4b78b47a9 | |
parent | d041233b98236ec26fc7150beb23a75cf1d1e54e (diff) |
if authorization error, log out
-rw-r--r-- | src/socket.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/socket.js b/src/socket.js index 59834d8..06cd7c6 100644 --- a/src/socket.js +++ b/src/socket.js @@ -77,7 +77,7 @@ export default class { const data = await dataPromise delete data.messageID - if (data.type == 'error' ) { + if (data.type == 'error') { throw data } else { return data @@ -118,6 +118,11 @@ export default class { } } } + } else if (data.type == 'error') { + if (data.reason == 'authorization') { + this.logOut() + } + throw data } } |