Skip to content

Fix fragile address extraction and improve provider logic - #1

Open
edgebrow wants to merge 1 commit into
masterfrom
fix/address-extraction-and-provider-logic
Open

edgebrow wants to merge 1 commit into
masterfrom
fix/address-extraction-and-provider-logic

Conversation

@edgebrow

@edgebrow edgebrow commented Jan 8, 2026

Copy link
Copy Markdown
Owner

This PR fixes several issues in the verification API:

  1. Fragile Address Extraction: Replaced regex-based address extraction with the official library's parser. This ensures the correct signer address is used even if other addresses appear in the message (e.g., in URLs or resources).
  2. Hardcoded Provider: Updated the main verification API to dynamically extract the provider from the SIWE message instead of hardcoding 'x'.
  3. Robust Resource Parsing: Improved the regex for parsing SIWE resources to handle cases where the last resource might not have a trailing newline.
  4. Code Cleanup: Removed redundant regex matches and improved error handling for invalid SIWE messages.

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.

1 participant