From 8ca207d31ef3eb9c3102f7fdb23f85b53d16924f Mon Sep 17 00:00:00 2001 From: anonymous Date: Wed, 21 Sep 2022 12:46:08 -0400 Subject: if authorization error, log out --- src/socket.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 } } -- cgit v1.2.3-70-g09d2