Skip to content

Commit 526ea1a

Browse files
Skip LocalDevice identity signers not on current device
1 parent 393fc21 commit 526ea1a

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

packages/wallet/wdk/src/sequence/sessions.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,11 +336,20 @@ export class Sessions implements SessionsInterface {
336336
continue
337337
}
338338
const iHandler = this.shared.handlers.get(identityKind)
339-
if (iHandler) {
340-
handler = iHandler
341-
identitySignerAddress = identitySigner
342-
break
339+
if (!iHandler) {
340+
continue
341+
}
342+
if (identityKind === Kinds.LocalDevice) {
343+
const hasLocalDevice = await this.shared.modules.devices.has(identitySigner)
344+
if (!hasLocalDevice) {
345+
console.warn('Implicit session identity signer not on this device, skipping', identitySigner)
346+
continue
347+
}
343348
}
349+
console.log('Implicit session will use identity signer', identitySigner, 'kind', identityKind)
350+
handler = iHandler
351+
identitySignerAddress = identitySigner
352+
break
344353
}
345354

346355
if (!handler || !identitySignerAddress) {

0 commit comments

Comments
 (0)