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:
parent
b2c0711676
commit
3d13c28cfc
1 changed files with 5 additions and 1 deletions
|
|
@ -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()
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue