Page MenuHomePhabricator

D11634.id39400.diff
No OneTemporary

D11634.id39400.diff

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
@@ -115,6 +115,33 @@
`This signature will attest that your Ethereum ` +
`identity is represented by your new Comm identity.`;
+const siweMessageSigningButtonStatement = 'Sign in using this wallet';
+
+const siweBackupMessageSigningExplanationStatements: string =
+ `Your signature on this message will be used to derive ` +
+ `a secret key that will encrypt your Comm backup.`;
+
+const siweBackupMessageSigningButtonStatement = 'Create a backup key';
+
+const userTextsForSIWEMessageTypes: {
+ +[signatureRequestType: string]: {
+ +explanationStatement: string,
+ +showTermsAgreement: boolean,
+ +buttonStatement: string,
+ },
+} = {
+ [SIWEMessageTypes.MSG_AUTH]: {
+ explanationStatement: siweMessageSigningExplanationStatements,
+ showTermsAgreement: true,
+ buttonStatement: siweMessageSigningButtonStatement,
+ },
+ [SIWEMessageTypes.MSG_BACKUP]: {
+ explanationStatement: siweBackupMessageSigningExplanationStatements,
+ showTermsAgreement: false,
+ buttonStatement: siweBackupMessageSigningButtonStatement,
+ },
+};
+
export {
isValidSIWENonce,
isValidEthereumAddress,
@@ -127,4 +154,8 @@
isValidSIWEStatementWithPublicKey,
getPublicKeyFromSIWEStatement,
siweMessageSigningExplanationStatements,
+ siweBackupMessageSigningExplanationStatements,
+ siweBackupMessageSigningButtonStatement,
+ siweMessageSigningButtonStatement,
+ userTextsForSIWEMessageTypes,
};

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 5, 11:04 AM (16 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2615262
Default Alt Text
D11634.id39400.diff (1 KB)

Event Timeline