From 00e6fa33a55ec5412c61fc98f3d153ab8b495b49 Mon Sep 17 00:00:00 2001 From: Archit Date: Wed, 11 Jan 2023 18:52:53 +0800 Subject: [PATCH 01/23] dont store whitelabel data --- src/store/actions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/store/actions.js b/src/store/actions.js index f02a05ba3..6d81c3b7b 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -653,7 +653,7 @@ export default { if (store.appState) { const appStateParams = JSON.parse(safeatob(store.appState)) - if (appStateParams?.whiteLabel) { + if (!isMain && appStateParams?.whiteLabel) { commit('setWhiteLabel', { ...appStateParams.whiteLabel }) } if ( From e2ca0fc0d71474170b492d9c36c69350e782113a Mon Sep 17 00:00:00 2001 From: torus-bot Date: Thu, 27 Jul 2023 03:58:33 +0000 Subject: [PATCH 02/23] update package-lock.json [skip ci] --- package-lock.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package-lock.json b/package-lock.json index 1e94c3b10..cc1606c8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10694,6 +10694,7 @@ "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.5.tgz", "integrity": "sha512-HTm14iMQKK2FjFLRTM5lAVcyaUzOnqbPtesFIvREgXpJHdQm8bWS+GkQgIkfaBYRHuCnea7w8UVNfwiAQhlr9A==", "dev": true, + "hasInstallScript": true, "optional": true, "dependencies": { "node-gyp-build": "^4.3.0" @@ -11051,6 +11052,7 @@ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.7.tgz", "integrity": "sha512-vLt1O5Pp+flcArHGIyKEQq883nBt8nN8tVBcoL0qUXj2XT1n7p70yGIq2VK98I5FdZ1YHc0wk/koOnHjnXWk1Q==", "dev": true, + "hasInstallScript": true, "optional": true, "dependencies": { "node-gyp-build": "^4.3.0" From 3c77663a3f0a7944381ff79b78b3104b1b5bd4ef Mon Sep 17 00:00:00 2001 From: torus-bot Date: Thu, 27 Jul 2023 03:58:35 +0000 Subject: [PATCH 03/23] Updating version to 2.2.6 [skip ci] --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc1606c8d..dc0c3da27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "app", - "version": "2.2.5", + "version": "2.2.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "app", - "version": "2.2.5", + "version": "2.2.6", "dependencies": { "@ethereumjs/common": "^3.2.0", "@ethereumjs/tx": "^4.2.0", diff --git a/package.json b/package.json index 1fe4d8392..c87c10304 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "2.2.5", + "version": "2.2.6", "private": true, "scripts": { "serve": "npm run locale && vue-cli-service serve", From 6f45fe355dbf27e22e5163f7033c5b4e2d07f8dc Mon Sep 17 00:00:00 2001 From: torus-bot Date: Wed, 16 Aug 2023 08:53:41 +0000 Subject: [PATCH 04/23] Updating version to 2.2.7 [skip ci] --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0ee45649..f7d97581b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "app", - "version": "2.2.6", + "version": "2.2.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "app", - "version": "2.2.6", + "version": "2.2.7", "dependencies": { "@ethereumjs/common": "^3.2.0", "@ethereumjs/tx": "^4.2.0", diff --git a/package.json b/package.json index 6bfc07554..1556724f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "2.2.6", + "version": "2.2.7", "private": true, "scripts": { "serve": "npm run locale && vue-cli-service serve", From cf497f632d9f9d3e680cf5e6aeed384f500f0791 Mon Sep 17 00:00:00 2001 From: torus-bot Date: Wed, 23 Aug 2023 15:20:55 +0000 Subject: [PATCH 05/23] Updating version to 2.2.8 [skip ci] --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 96325cada..d93c19edb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "app", - "version": "2.2.7", + "version": "2.2.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "app", - "version": "2.2.7", + "version": "2.2.8", "dependencies": { "@ethereumjs/common": "^3.2.0", "@ethereumjs/tx": "^4.2.0", diff --git a/package.json b/package.json index aef10c24f..3f6d702b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "2.2.7", + "version": "2.2.8", "private": true, "scripts": { "serve": "npm run locale && vue-cli-service serve", From b0095ed3c41a954cbd8899050002f9ca1ccbed3c Mon Sep 17 00:00:00 2001 From: torus-bot Date: Fri, 25 Aug 2023 03:19:50 +0000 Subject: [PATCH 06/23] Updating version to 2.2.9 [skip ci] --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d93c19edb..28e442671 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "app", - "version": "2.2.8", + "version": "2.2.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "app", - "version": "2.2.8", + "version": "2.2.9", "dependencies": { "@ethereumjs/common": "^3.2.0", "@ethereumjs/tx": "^4.2.0", diff --git a/package.json b/package.json index 3f6d702b1..8d245c185 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "2.2.8", + "version": "2.2.9", "private": true, "scripts": { "serve": "npm run locale && vue-cli-service serve", From 14cfc31077e1b39cedb688292f7f60f7d3b049dc Mon Sep 17 00:00:00 2001 From: torus-bot Date: Fri, 8 Sep 2023 05:34:39 +0000 Subject: [PATCH 07/23] update package-lock.json [skip ci] --- package-lock.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package-lock.json b/package-lock.json index ace9f3400..aeadb2df7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3890,6 +3890,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.1.tgz", "integrity": "sha512-qNrYbZqMx0uJAfKnKclPh+dTwK33KfLHYqtyODwd5HnXOjnkhc4qgn3BrK6RWyGZm5+sIFE7Q7Vz6QQtJB7w7g==", + "peer": true, "dependencies": { "@types/node": "*" } From 411762f95471658c0cb7ebbde258382d90a78719 Mon Sep 17 00:00:00 2001 From: torus-bot Date: Fri, 8 Sep 2023 05:34:42 +0000 Subject: [PATCH 08/23] Updating version to 3.0.0 [skip ci] --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index aeadb2df7..8c265dc83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "app", - "version": "2.2.9", + "version": "3.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "app", - "version": "2.2.9", + "version": "3.0.0", "dependencies": { "@ethereumjs/common": "^3.2.0", "@ethereumjs/tx": "^4.2.0", diff --git a/package.json b/package.json index 8d245c185..99784dc3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "2.2.9", + "version": "3.0.0", "private": true, "scripts": { "serve": "npm run locale && vue-cli-service serve", From 467d951fea37b646671a772ae0e77af3b07bdf73 Mon Sep 17 00:00:00 2001 From: Archit Date: Mon, 25 Sep 2023 21:47:46 +0800 Subject: [PATCH 09/23] fix error handling --- src/handlers/Auth/OpenLoginWindowHandler.js | 8 ++++- src/handlers/Popup/PopupWithBcHandler.js | 1 + src/utils/utils.js | 5 +-- src/views/End/End.vue | 34 +++++++++++++++------ 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/src/handlers/Auth/OpenLoginWindowHandler.js b/src/handlers/Auth/OpenLoginWindowHandler.js index e01fca8b9..3592a2b68 100644 --- a/src/handlers/Auth/OpenLoginWindowHandler.js +++ b/src/handlers/Auth/OpenLoginWindowHandler.js @@ -1,4 +1,4 @@ -import { safebtoa } from '@toruslabs/openlogin-utils' +import { safebtoa, storageAvailable } from '@toruslabs/openlogin-utils' import log from 'loglevel' import config from '../../config' @@ -60,6 +60,9 @@ class OpenLoginWindowHandler { if (!this.verifier || !typeOfLogin || !clientId) { throw new Error('Invalid params') } + if (storageAvailable('localStorage')) { + localStorage.setItem('broadcast_channel_id', this.nonce) + } const channelName = `redirect_openlogin_channel_${this.nonce}` log.info('channelname', channelName) const verifierWindow = new PopupWithBcHandler({ @@ -69,6 +72,9 @@ class OpenLoginWindowHandler { timeout: getTimeout({ typeOfLogin }), }) const result = await verifierWindow.handle() + if (storageAvailable('localStorage')) { + localStorage.removeItem('broadcast_channel_id') + } return result } } diff --git a/src/handlers/Popup/PopupWithBcHandler.js b/src/handlers/Popup/PopupWithBcHandler.js index fa3e96bd3..ddd5f3233 100644 --- a/src/handlers/Popup/PopupWithBcHandler.js +++ b/src/handlers/Popup/PopupWithBcHandler.js @@ -28,6 +28,7 @@ class PopupWithBcHandler extends PopupHandler { if (successExtraFn) await successExtraFn.call(this, data) resolve(data) } catch (error) { + log.error('message error', error) reject(error) } finally { this.bc.close() diff --git a/src/utils/utils.js b/src/utils/utils.js index bbc5f1e87..094846b32 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -10,6 +10,7 @@ import { } from '@ethereumjs/util' import { concatSig, normalize } from '@metamask/eth-sig-util' import { keccak256 } from '@toruslabs/metadata-helpers' +import { safeatob } from '@toruslabs/openlogin-utils' import assert from 'assert' import BigNumber from 'bignumber.js' import BN from 'bn.js' @@ -872,10 +873,10 @@ export const handleRedirectParameters = (hash, queryParameters) => { let error = '' if (!queryParameters.preopenInstanceId) { if (Object.keys(hashParameters).length > 0 && hashParameters.state) { - instanceParameters = JSON.parse(atob(decodeURIComponent(decodeURIComponent(hashParameters.state)))) || {} + instanceParameters = JSON.parse(safeatob(decodeURIComponent(decodeURIComponent(hashParameters.state)))) || {} error = hashParameters.error_description || hashParameters.error || error } else if (Object.keys(queryParameters).length > 0 && queryParameters.state) { - instanceParameters = JSON.parse(atob(decodeURIComponent(decodeURIComponent(queryParameters.state)))) || {} + instanceParameters = JSON.parse(safeatob(decodeURIComponent(decodeURIComponent(queryParameters.state)))) || {} if (queryParameters.error) error = queryParameters.error } } diff --git a/src/views/End/End.vue b/src/views/End/End.vue index 18d7b874f..4b4026d31 100644 --- a/src/views/End/End.vue +++ b/src/views/End/End.vue @@ -44,7 +44,7 @@