summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheia2022-08-01 15:39:00 -0400
committertheia2022-08-01 15:39:00 -0400
commitf8adb58097591481873afac85e7ba011b26adfb0 (patch)
treed98a6c6b836f6c7f0f82ca459514faa4b78b47a9
parent38ca42741bd3e27f0954bb11e81729dd8f7806e9 (diff)
if authorization error, log out
-rw-r--r--src/socket.js7
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
}
}