Skip to content

Commit 7cebabd

Browse files
Merge pull request #235 from Web3Auth/feat/openlogin-curve
add curve param for id token support
2 parents 4c86489 + fbdfca2 commit 7cebabd

File tree

9 files changed

+2429
-2511
lines changed

9 files changed

+2429
-2511
lines changed

examples/vue-app/package-lock.json

Lines changed: 2065 additions & 2120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,29 @@
2727
"prepare": "husky install"
2828
},
2929
"devDependencies": {
30-
"@toruslabs/eslint-config-typescript": "^1.0.2",
31-
"@toruslabs/torus-scripts": "^1.0.4",
30+
"@toruslabs/eslint-config-typescript": "^1.0.3",
31+
"@toruslabs/torus-scripts": "^1.0.5",
3232
"@types/node": "^16",
33-
"@typescript-eslint/eslint-plugin": "^5.27.1",
33+
"@typescript-eslint/eslint-plugin": "^5.29.0",
3434
"cross-env": "^7.0.3",
35-
"eslint": "^8.17.0",
35+
"eslint": "^8.18.0",
3636
"eslint-plugin-import": "^2.26.0",
3737
"eslint-plugin-mocha": "^10.0.5",
38-
"eslint-plugin-n": "^15.2.2",
38+
"eslint-plugin-n": "^15.2.3",
3939
"eslint-plugin-prettier": "^4.0.0",
4040
"eslint-plugin-promise": "^6.0.0",
4141
"eslint-plugin-simple-import-sort": "^7.0.0",
4242
"eslint-plugin-tsdoc": "^0.2.16",
4343
"husky": "^8.0.1",
4444
"lerna": "^4.0.0",
45-
"lint-staged": "^13.0.1",
46-
"prettier": "^2.6.2",
45+
"lint-staged": "^13.0.2",
46+
"prettier": "^2.7.1",
4747
"rimraf": "^3.0.2",
4848
"ts-node": "^10.8.1",
4949
"tsconfig-paths": "^4.0.0",
5050
"tsconfig-paths-webpack-plugin": "^3.5.2",
5151
"tslib": "^2.4.0",
52-
"typescript": "^4.7.3"
52+
"typescript": "^4.7.4"
5353
},
5454
"repository": {
5555
"type": "git",

packages/adapters/openlogin-adapter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@types/lodash.merge": "^4.6.7"
3939
},
4040
"dependencies": {
41-
"@toruslabs/openlogin": "^2.1.0",
41+
"@toruslabs/openlogin": "^2.2.0",
4242
"@toruslabs/openlogin-ed25519": "^2.0.0",
4343
"@web3auth/base": "^1.0.1",
4444
"@web3auth/base-provider": "^1.0.1",

packages/adapters/openlogin-adapter/src/openloginAdapter.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import OpenLogin, { getHashQueryParams, LoginParams, OPENLOGIN_NETWORK, OpenLoginOptions, UX_MODE } from "@toruslabs/openlogin";
1+
import OpenLogin, { getHashQueryParams, LoginParams, OPENLOGIN_NETWORK, OpenLoginOptions, SUPPORTED_KEY_CURVES, UX_MODE } from "@toruslabs/openlogin";
22
import {
33
ADAPTER_CATEGORY,
44
ADAPTER_CATEGORY_TYPE,
@@ -196,6 +196,10 @@ export class OpenloginAdapter extends BaseAdapter<OpenloginLoginParams> {
196196
}
197197
// if not logged in then login
198198
if (!this.openloginInstance.privKey && params) {
199+
if (!this.loginSettings.curve) {
200+
this.loginSettings.curve =
201+
this.currentChainNamespace === CHAIN_NAMESPACES.SOLANA ? SUPPORTED_KEY_CURVES.ED25519 : SUPPORTED_KEY_CURVES.SECP256K1;
202+
}
199203
await this.openloginInstance.login(
200204
merge(
201205
this.loginSettings,

packages/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"ts-custom-error": "^3.2.0"
2525
},
2626
"devDependencies": {
27-
"@toruslabs/openlogin": "^2.1.0"
27+
"@toruslabs/openlogin": "^2.2.0"
2828
},
2929
"files": [
3030
"dist",

packages/base/src/adapter/IAdapter.ts

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CUSTOM_LOGIN_PROVIDER_TYPE, LOGIN_PROVIDER_TYPE } from "@toruslabs/openlogin";
1+
import type { OpenloginUserInfo } from "@toruslabs/openlogin";
22
import { SafeEventEmitter } from "@toruslabs/openlogin-jrpc";
33

44
import { getChainConfig } from "../chain/config";
@@ -7,41 +7,7 @@ import { WalletInitializationError, WalletLoginError } from "../errors";
77
import { SafeEventEmitterProvider } from "../provider/IProvider";
88
import { WALLET_ADAPTERS } from "../wallet";
99

10-
export type UserInfo = {
11-
/**
12-
* Email of the logged in user
13-
*/
14-
email: string;
15-
/**
16-
* Full name of the logged in user
17-
*/
18-
name: string;
19-
/**
20-
* Profile image of the logged in user
21-
*/
22-
profileImage: string;
23-
/**
24-
* verifier of the logged in user (google, facebook etc)
25-
*/
26-
verifier: string;
27-
/**
28-
* Verifier Id of the logged in user
29-
*
30-
* email for google,
31-
* id for facebook,
32-
* username for reddit,
33-
* id for twitch,
34-
* id for discord
35-
*/
36-
verifierId: string;
37-
38-
aggregateVerifier?: string;
39-
40-
/**
41-
* typeOfLogin of the logged in user (google, facebook etc)
42-
*/
43-
typeOfLogin: LOGIN_PROVIDER_TYPE | CUSTOM_LOGIN_PROVIDER_TYPE;
44-
};
10+
export type UserInfo = OpenloginUserInfo;
4511

4612
export const ADAPTER_CATEGORY = {
4713
EXTERNAL: "external",

packages/modal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"@svgr/webpack": "^6.2.1",
34-
"@toruslabs/openlogin": "^2.1.0",
34+
"@toruslabs/openlogin": "^2.2.0",
3535
"@types/node": "^16",
3636
"css-loader": "^6.7.1",
3737
"style-loader": "^3.3.1",

packages/ui/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@babel/preset-react": "^7.17.12",
4040
"@svgr/rollup": "^6.2.1",
4141
"@svgr/webpack": "^6.2.1",
42-
"@toruslabs/eslint-config-react": "^1.0.2",
42+
"@toruslabs/eslint-config-react": "^1.0.3",
4343
"@types/lodash.clonedeep": "^4.5.7",
4444
"@types/lodash.merge": "^4.6.7",
4545
"@types/react": "^17.0.43",
@@ -48,7 +48,7 @@
4848
"eslint-plugin-import": "^2.26.0",
4949
"eslint-plugin-jsx-a11y": "^6.5.1",
5050
"eslint-plugin-react": "^7.30.0",
51-
"eslint-plugin-react-hooks": "^4.5.0",
51+
"eslint-plugin-react-hooks": "^4.6.0",
5252
"eslint-plugin-simple-import-sort": "^7.0.0",
5353
"live-server": "^1.2.2",
5454
"postcss": "^8.4.14",
@@ -58,7 +58,7 @@
5858
"url-loader": "^4.1.1"
5959
},
6060
"dependencies": {
61-
"@toruslabs/openlogin": "^2.1.0",
61+
"@toruslabs/openlogin": "^2.2.0",
6262
"@toruslabs/openlogin-jrpc": "^2.1.0",
6363
"@web3auth/base": "^1.0.1",
6464
"bowser": "^2.11.0",

0 commit comments

Comments
 (0)