diff --git a/examples/vue-app/package-lock.json b/examples/vue-app/package-lock.json index 70ccf52..87f0bdd 100644 --- a/examples/vue-app/package-lock.json +++ b/examples/vue-app/package-lock.json @@ -13,7 +13,7 @@ "@toruslabs/customauth": "file:../../", "@toruslabs/fnd-base": "^14.0.0", "@toruslabs/openlogin-starkkey": "^3.2.0", - "@toruslabs/torus.js": "^15.0.2", + "@toruslabs/torus.js": "^15.1.0-0", "@toruslabs/vue-components": "^7.8.3", "@toruslabs/vue-icons": "^7.6.2", "@web3auth/base": "^8.12.0", @@ -55,7 +55,7 @@ "@toruslabs/http-helpers": "^7.0.0", "@toruslabs/metadata-helpers": "^6.0.0", "@toruslabs/session-manager": "^3.1.0", - "@toruslabs/torus.js": "^15.0.4", + "@toruslabs/torus.js": "^15.1.0-0", "base64url": "^3.0.1", "bowser": "^2.11.0", "deepmerge": "^4.3.1", @@ -63,7 +63,7 @@ "loglevel": "^1.9.2" }, "devDependencies": { - "@sentry/types": "^8.31.0", + "@sentry/types": "^8.33.1", "@toruslabs/config": "^2.2.0", "@toruslabs/eslint-config-typescript": "^3.3.3", "@toruslabs/torus-scripts": "^6.1.2", @@ -13708,9 +13708,9 @@ } }, "node_modules/@toruslabs/torus.js": { - "version": "15.0.2", - "resolved": "https://registry.npmjs.org/@toruslabs/torus.js/-/torus.js-15.0.2.tgz", - "integrity": "sha512-VRwCVFYUm5pmbvKg00ZMTSEEwZ0jQradqngGJMXum5hDoKXuJwLvePa4e0ggFq5uwr3bdszpsN0iNLCSMKKbOw==", + "version": "15.1.0-0", + "resolved": "https://registry.npmjs.org/@toruslabs/torus.js/-/torus.js-15.1.0-0.tgz", + "integrity": "sha512-L0ID5LpP6GWqNj+IPW2MBm1MG8bgUG0uw/naGle1/2EMv1vr8YEu49q53J7GXvqD8i2dzXYCWYRzHgdcOBYBKg==", "license": "MIT", "dependencies": { "@toruslabs/bs58": "^1.0.0", diff --git a/examples/vue-app/package.json b/examples/vue-app/package.json index df01202..0943ca7 100644 --- a/examples/vue-app/package.json +++ b/examples/vue-app/package.json @@ -15,7 +15,7 @@ "@toruslabs/customauth": "file:../../", "@toruslabs/fnd-base": "^14.0.0", "@toruslabs/openlogin-starkkey": "^3.2.0", - "@toruslabs/torus.js": "^15.0.2", + "@toruslabs/torus.js": "^15.1.0-0", "@toruslabs/vue-components": "^7.8.3", "@toruslabs/vue-icons": "^7.6.2", "@web3auth/base": "^8.12.0", diff --git a/examples/vue-app/src/App.vue b/examples/vue-app/src/App.vue index e9124a4..3116eb3 100644 --- a/examples/vue-app/src/App.vue +++ b/examples/vue-app/src/App.vue @@ -316,6 +316,7 @@ const initCustomAuth = async () => { uxMode, web3AuthClientId: WEB3AUTH_CLIENT_ID, nodeDetails, + checkCommitment: false, }); await customAuthSdk.value.init({ skipSw: true }); break; @@ -330,6 +331,7 @@ const initCustomAuth = async () => { popupFeatures: `titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=500,width=500,top=100,left=100`, web3AuthClientId: WEB3AUTH_CLIENT_ID, nodeDetails, + checkCommitment: false, }); await customAuthSdk.value.init(); break; diff --git a/package-lock.json b/package-lock.json index 2f4ce72..1caafcf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@toruslabs/http-helpers": "^7.0.0", "@toruslabs/metadata-helpers": "^6.0.0", "@toruslabs/session-manager": "^3.1.0", - "@toruslabs/torus.js": "^15.0.4", + "@toruslabs/torus.js": "^15.1.0-0", "base64url": "^3.0.1", "bowser": "^2.11.0", "deepmerge": "^4.3.1", @@ -25,7 +25,7 @@ "loglevel": "^1.9.2" }, "devDependencies": { - "@sentry/types": "^8.31.0", + "@sentry/types": "^8.33.1", "@toruslabs/config": "^2.2.0", "@toruslabs/eslint-config-typescript": "^3.3.3", "@toruslabs/torus-scripts": "^6.1.2", @@ -3095,9 +3095,9 @@ } }, "node_modules/@sentry/types": { - "version": "8.31.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.31.0.tgz", - "integrity": "sha512-prRM/n5nlP+xQZSpdEkSR8BwwZtgsLk0NbI8eCjTMu2isVlrlggop8pVaJb7y9HmElVtDA1Q6y4u8TD2htQKFQ==", + "version": "8.33.1", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.33.1.tgz", + "integrity": "sha512-GjoAMvwtpIemoF/IiwZ7A60g4nQv3qwzR21GvJqDVUoKD0e8pv9OLX+HyXoUat4wEDGSuDUcUyUKD2G+od73QA==", "devOptional": true, "license": "MIT", "engines": { @@ -3669,9 +3669,9 @@ } }, "node_modules/@toruslabs/torus.js": { - "version": "15.0.4", - "resolved": "https://registry.npmjs.org/@toruslabs/torus.js/-/torus.js-15.0.4.tgz", - "integrity": "sha512-+fmVA0oPx0ruEm8OARYsrcvKd+sZpH7r1XUxmJjwF/V69el4/f2xMQTcDI0IAR+xDlx+X+ZJaFsczDanCG3NnQ==", + "version": "15.1.0-0", + "resolved": "https://registry.npmjs.org/@toruslabs/torus.js/-/torus.js-15.1.0-0.tgz", + "integrity": "sha512-L0ID5LpP6GWqNj+IPW2MBm1MG8bgUG0uw/naGle1/2EMv1vr8YEu49q53J7GXvqD8i2dzXYCWYRzHgdcOBYBKg==", "license": "MIT", "dependencies": { "@toruslabs/bs58": "^1.0.0", diff --git a/package.json b/package.json index ed7ff0f..df4abf8 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@toruslabs/http-helpers": "^7.0.0", "@toruslabs/metadata-helpers": "^6.0.0", "@toruslabs/session-manager": "^3.1.0", - "@toruslabs/torus.js": "^15.0.4", + "@toruslabs/torus.js": "^15.1.0-0", "base64url": "^3.0.1", "bowser": "^2.11.0", "deepmerge": "^4.3.1", @@ -47,7 +47,7 @@ "loglevel": "^1.9.2" }, "devDependencies": { - "@sentry/types": "^8.31.0", + "@sentry/types": "^8.33.1", "@toruslabs/config": "^2.2.0", "@toruslabs/eslint-config-typescript": "^3.3.3", "@toruslabs/torus-scripts": "^6.1.2", diff --git a/src/handlers/interfaces.ts b/src/handlers/interfaces.ts index ba6f46e..451aa08 100644 --- a/src/handlers/interfaces.ts +++ b/src/handlers/interfaces.ts @@ -243,6 +243,13 @@ export interface CustomAuthArgs { useDkg?: boolean; nodeDetails?: INodeDetails; + + /** + * Set this flag to false to remove check for commitment calls. + * + * @defaultValue true + */ + checkCommitment?: boolean; } export interface InitParams { diff --git a/src/login.ts b/src/login.ts index bd718fe..e46e4bd 100644 --- a/src/login.ts +++ b/src/login.ts @@ -43,6 +43,7 @@ class CustomAuth { web3AuthNetwork: TORUS_NETWORK_TYPE; keyType: KeyType; nodeDetails: INodeDetails; + checkCommitment: boolean; }; torus: Torus; @@ -72,6 +73,7 @@ class CustomAuth { keyType = "secp256k1", serverTimeOffset = 0, nodeDetails, + checkCommitment = true, }: CustomAuthArgs) { if (!web3AuthClientId) throw new Error("Please provide a valid web3AuthClientId in constructor"); if (!network) throw new Error("Please provide a valid network in constructor"); @@ -91,6 +93,7 @@ class CustomAuth { web3AuthNetwork: network, keyType, nodeDetails, + checkCommitment, }; const torus = new Torus({ network, @@ -311,6 +314,7 @@ class CustomAuth { ...additionalParams, }, useDkg: this.config.useDkg, + checkCommitment: this.config.checkCommitment, }); } );