mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
use reauthenticate
This commit is contained in:
parent
791a42c020
commit
a1617c2e66
@ -94,11 +94,19 @@ export async function createWebsockets() {
|
||||
}
|
||||
}
|
||||
|
||||
export async function reconnectWebsockets() {
|
||||
export async function reconnectWebsockets({ force = false } = {}) {
|
||||
const instances = globalThis.__comty_shared_state.wsInstances
|
||||
|
||||
for (let [key, instance] of Object.entries(instances)) {
|
||||
if (instance.connected) {
|
||||
if (!force) {
|
||||
instance.emit("reauthenticate", {
|
||||
token: SessionModel.token,
|
||||
})
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
// disconnect first
|
||||
instance.disconnect()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user