Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throw if popup is blocked #274

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
709 changes: 475 additions & 234 deletions examples/vue-example/package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions examples/vue-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
"@toruslabs/tss-client": "^2.0.0",
"@toruslabs/tss-lib": "^2.0.0",
"@web3auth-mpc/ethereum-provider": "^3.0.0",
"@web3auth/ethereum-provider": "^7.0.4",
"@web3auth/ethereum-provider": "^7.1.2",
"bn.js": "^5.2.1",
"bs58": "^5.0.0",
"core-js": "^3.33.2",
"core-js": "^3.33.3",
"elliptic": "^6.5.4",
"ethereum-cryptography": "^2.1.2",
"ethers": "^6.8.0",
"ethers": "^6.8.1",
"openlogin": "file:../../packages/wrapper/",
"vue": "^3.3.7"
"vue": "^3.3.8"
},
"devDependencies": {
"@toruslabs/constants": "^13.0.3",
"@types/bs58": "^4.0.3",
"@types/elliptic": "^6.4.16",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"@toruslabs/constants": "^13.0.4",
"@types/bs58": "^4.0.4",
"@types/elliptic": "^6.4.18",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@vue/cli-plugin-babel": "~5.0.8",
"@vue/cli-plugin-eslint": "~5.0.8",
"@vue/cli-plugin-typescript": "~5.0.8",
Expand All @@ -42,16 +42,16 @@
"autoprefixer": "^10.4.16",
"babel-eslint": "^10.1.0",
"crypto-browserify": "^3.12.0",
"eslint": "^8.52.0",
"eslint": "^8.54.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-vue": "^9.18.1",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
"postcss": "^8.4.31",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"tailwindcss": "^3.3.5",
"typescript": "~5.2.2",
"typescript": "~5.3.2",
"vue-template-compiler": "^2.7.15"
}
}
112 changes: 56 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@
},
"devDependencies": {
"@babel/register": "^7.22.15",
"@babel/runtime": "^7.23.2",
"@babel/runtime": "^7.23.4",
"@rollup/plugin-replace": "^5.0.5",
"@toruslabs/config": "^2.0.2",
"@toruslabs/eslint-config-typescript": "^3.0.2",
"@toruslabs/torus-scripts": "^5.0.6",
"@types/mocha": "^10.0.3",
"@types/mocha": "^10.0.6",
"@types/node": "^20",
"cross-env": "^7.0.3",
"eslint": "^8.52.0",
"eslint": "^8.54.0",
"husky": "^8.0.3",
"jsdom": "^22.1.0",
"jsdom-global": "^3.0.2",
"lerna": "^7.4.2",
"lint-staged": "^15.0.2",
"lint-staged": "^15.1.0",
"mocha": "^10.2.0",
"prettier": "^3.0.3",
"prettier": "^3.1.0",
"rimraf": "^5.0.5",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"tslib": "^2.6.2",
"typescript": "^5.2.2"
"typescript": "^5.3.2"
},
"author": "Torus Labs",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions packages/openlogin-jrpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"readable-stream": "^4.4.2"
},
"devDependencies": {
"@types/end-of-stream": "^1.4.3",
"@types/once": "^1.4.2",
"@types/pump": "^1.1.2",
"@types/readable-stream": "^4.0.4"
"@types/end-of-stream": "^1.4.4",
"@types/once": "^1.4.4",
"@types/pump": "^1.1.3",
"@types/readable-stream": "^4.0.9"
},
"peerDependencies": {
"@babel/runtime": "7.x"
Expand Down
2 changes: 1 addition & 1 deletion packages/openlogin-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"pre-commit": "lint-staged --cwd ."
},
"dependencies": {
"@toruslabs/constants": "^13.0.3",
"@toruslabs/constants": "^13.0.4",
"base64url": "^3.0.1"
},
"peerDependencies": {
Expand Down
6 changes: 5 additions & 1 deletion packages/openlogin/src/OpenLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,11 @@ class OpenLogin {

currentWindow.listenOnChannel(loginId).then(resolve).catch(reject);

currentWindow.open();
try {
currentWindow.open();
} catch (error) {
reject(error);
}
});
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/openlogin/src/PopupHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PopupHandler extends EventEmitter {

open(): void {
this.window = window.open(this.url, this.target, this.features);
if (!this.window) throw new Error("Popup was blocked. Please call this function as soon as user clicks button or use redirect mode");
if (this.window?.focus) this.window.focus();
}

Expand Down
Loading
Loading