Skip to content

Commit 95f63dd

Browse files
committed
Don't catch errors thrown by Guard 2FA or reject early to allow multiple attempts on incorrect TOTP
1 parent 05ff518 commit 95f63dd

File tree

1 file changed

+3
-7
lines changed
  • packages/wallet/wdk/src/sequence/handlers

1 file changed

+3
-7
lines changed

packages/wallet/wdk/src/sequence/handlers/guard.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,9 @@ export class GuardHandler implements Handler {
9696
} catch (e) {
9797
if (e instanceof Guard.AuthRequiredError) {
9898
const respond: RespondFn = async (token) => {
99-
try {
100-
const signature = await guard.signEnvelope(request.envelope, token)
101-
await this.signatures.addSignature(request.id, signature)
102-
resolve(true)
103-
} catch (e) {
104-
reject(e)
105-
}
99+
const signature = await guard.signEnvelope(request.envelope, token)
100+
await this.signatures.addSignature(request.id, signature)
101+
resolve(true)
106102
}
107103

108104
await onPromptCode(request, e.id, respond)

0 commit comments

Comments
 (0)