mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-26 20:45:37 +02:00
feat(store): pass hubId and token to GatewayClient for verification
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,8 @@ let client: GatewayClient | null = null
|
||||
function createClient(
|
||||
url: string,
|
||||
deviceId: string,
|
||||
hubId: string,
|
||||
token: string,
|
||||
set: (s: Partial<ConnectionStoreState>) => void,
|
||||
getState: () => ConnectionStoreState,
|
||||
): GatewayClient {
|
||||
@@ -80,6 +82,8 @@ function createClient(
|
||||
url,
|
||||
deviceId,
|
||||
deviceType: "client",
|
||||
hubId,
|
||||
token,
|
||||
})
|
||||
// Sync connection state changes to the store
|
||||
.onStateChange((connectionState) => {
|
||||
@@ -192,7 +196,7 @@ export const useConnectionStore = create<ConnectionStore>()(
|
||||
agentId: code.agentId,
|
||||
})
|
||||
|
||||
client = createClient(code.gateway, get().deviceId, set, get)
|
||||
client = createClient(code.gateway, get().deviceId, code.hubId, code.token, set, get)
|
||||
client.connect()
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user