mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +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)) {
|
||||
if (instance.connected) {
|
||||
if (!instance.auth) {
|
||||
instance.disconnect()
|
||||
|
||||
instance.auth = {
|
||||
token: SessionModel.token,
|
||||
}
|
||||
|
||||
instance.connect()
|
||||
continue
|
||||
}
|
||||
|
||||
if (!force) {
|
||||
instance.emit("reauthenticate", {
|
||||
token: SessionModel.token,
|
||||
|
Loading…
x
Reference in New Issue
Block a user