mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
reconnect if instance has no auth token
This commit is contained in:
parent
9cf49eb9fd
commit
ca569b3eaa
@ -99,6 +99,17 @@ export async function reconnectWebsockets({ force = false } = {}) {
|
|||||||
|
|
||||||
for (let [key, instance] of Object.entries(instances)) {
|
for (let [key, instance] of Object.entries(instances)) {
|
||||||
if (instance.connected) {
|
if (instance.connected) {
|
||||||
|
if (!instance.auth) {
|
||||||
|
instance.disconnect()
|
||||||
|
|
||||||
|
instance.auth = {
|
||||||
|
token: SessionModel.token,
|
||||||
|
}
|
||||||
|
|
||||||
|
instance.connect()
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if (!force) {
|
if (!force) {
|
||||||
instance.emit("reauthenticate", {
|
instance.emit("reauthenticate", {
|
||||||
token: SessionModel.token,
|
token: SessionModel.token,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user