Skip to content

Commit f36b02f

Browse files
authored
fix: SIWE detection on mobile by patching @spruceid+siwe-parser (#13334)
## **Description** Fix SIWE detection on mobile by patching @spruceid+siwe-parser The module is already patched for this issue on extension: MetaMask/metamask-extension#24138 ## **Related issues** Related to: MetaMask/MetaMask-planning#2278 Related to: MetaMask/MetaMask-planning#4076 ## **Manual testing steps** NA ## **Screenshots/Recordings** NA ## **Pre-merge author checklist** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent d9d4de0 commit f36b02f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/node_modules/@spruceid/siwe-parser/dist/abnf.js b/node_modules/@spruceid/siwe-parser/dist/abnf.js
2+
index 15caf98..0eeac1e 100644
3+
--- a/node_modules/@spruceid/siwe-parser/dist/abnf.js
4+
+++ b/node_modules/@spruceid/siwe-parser/dist/abnf.js
5+
@@ -290,9 +290,6 @@ class ParsedMessage {
6+
if (this.domain.length === 0) {
7+
throw new Error("Domain cannot be empty.");
8+
}
9+
- if (!(0, utils_1.isEIP55Address)(this.address)) {
10+
- throw new Error("Address not conformant to EIP-55.");
11+
- }
12+
}
13+
}
14+
exports.ParsedMessage = ParsedMessage;
15+
diff --git a/node_modules/@spruceid/siwe-parser/dist/regex.js b/node_modules/@spruceid/siwe-parser/dist/regex.js
16+
index 4740a7c..f1d880d 100644
17+
--- a/node_modules/@spruceid/siwe-parser/dist/regex.js
18+
+++ b/node_modules/@spruceid/siwe-parser/dist/regex.js
19+
@@ -55,9 +55,6 @@ class ParsedMessage {
20+
throw new Error("Domain cannot be empty.");
21+
}
22+
this.address = (_b = match === null || match === void 0 ? void 0 : match.groups) === null || _b === void 0 ? void 0 : _b.address;
23+
- if (!(0, utils_1.isEIP55Address)(this.address)) {
24+
- throw new Error("Address not conformant to EIP-55.");
25+
- }
26+
this.statement = (_c = match === null || match === void 0 ? void 0 : match.groups) === null || _c === void 0 ? void 0 : _c.statement;
27+
this.uri = (_d = match === null || match === void 0 ? void 0 : match.groups) === null || _d === void 0 ? void 0 : _d.uri;
28+
if (!uri.isUri(this.uri)) {

0 commit comments

Comments
 (0)