Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3489164
D6737.id22612.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6737.id22612.diff
View Options
diff --git a/lib/utils/siwe-utils.js b/lib/utils/siwe-utils.js
--- a/lib/utils/siwe-utils.js
+++ b/lib/utils/siwe-utils.js
@@ -44,8 +44,18 @@
return message.prepareMessage();
}
-const expectedDomain = isDev ? 'localhost:3000' : 'comm.app';
-const expectedURI = isDev ? 'http://localhost:3000' : 'https://comm.app';
+function isValidSIWEDomain(candidate: string): boolean {
+ return isDev
+ ? candidate === 'localhost:3000'
+ : candidate === 'comm.app' || candidate === 'web.comm.app';
+}
+
+function isValidSIWEURI(candidate: string): boolean {
+ return isDev
+ ? candidate === 'http://localhost:3000'
+ : candidate === 'https://comm.app' || candidate === 'https://web.comm.app';
+}
+
// Verify that the SIWEMessage is a well formed Comm SIWE Auth message.
function isValidSIWEMessage(candidate: SIWEMessage): boolean {
return (
@@ -55,8 +65,8 @@
isValidSIWEStatementWithPublicKey(candidate.statement))) &&
candidate.version === '1' &&
candidate.chainId === 1 &&
- candidate.domain === expectedDomain &&
- candidate.uri === expectedURI &&
+ isValidSIWEDomain(candidate.domain) &&
+ isValidSIWEURI(candidate.uri) &&
isValidSIWENonce(candidate.nonce) &&
isValidEthereumAddress(candidate.address)
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 11:52 AM (21 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2676508
Default Alt Text
D6737.id22612.diff (1 KB)
Attached To
Mode
D6737: [lib] Prepend `expected[Domain/URI]` with `web.` to fix SIWE on prod
Attached
Detach File
Event Timeline
Log In to Comment