Skip to content

fix(client): do not log signature recovery errors to console.error - #218

Open
SnowingFox wants to merge 1 commit into
spruceid:mainfrom
SnowingFox:fix/siwe-172-remove-console-error
Open

fix(client): do not log signature recovery errors to console.error#218
SnowingFox wants to merge 1 commit into
spruceid:mainfrom
SnowingFox:fix/siwe-172-remove-console-error

Conversation

@SnowingFox

Copy link
Copy Markdown

Summary

Fixes #172. The verify() path in packages/siwe/lib/client.ts calls console.error(e) inside the try/catch that recovers the signer address from the signature. A library logging internally like this pollutes application output and breaks consumers with custom logging flows (e.g. JSON-formatted logs for SaaS log analysis).

Change

  • Removed the console.error(e) call. On an unrecoverable signature (e.g. malformed), addr stays undefined and the existing address-match / EIP-1271 fallback path reports the verification as an INVALID_SIGNATURE failure exactly as before — no behavior change, just no internal logging.
  • Added a regression test asserting that verifying a message with a malformed signature does not write to console.error while still returning a failed verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid signature recovery are logged via console.error, breaking applications with custom logging flow

1 participant