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

add curve param for id token support #235

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
4,185 changes: 2,065 additions & 2,120 deletions examples/vue-app/package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,29 @@
"prepare": "husky install"
},
"devDependencies": {
"@toruslabs/eslint-config-typescript": "^1.0.2",
"@toruslabs/torus-scripts": "^1.0.4",
"@toruslabs/eslint-config-typescript": "^1.0.3",
"@toruslabs/torus-scripts": "^1.0.5",
"@types/node": "^16",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"cross-env": "^7.0.3",
"eslint": "^8.17.0",
"eslint": "^8.18.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-mocha": "^10.0.5",
"eslint-plugin-n": "^15.2.2",
"eslint-plugin-n": "^15.2.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-tsdoc": "^0.2.16",
"husky": "^8.0.1",
"lerna": "^4.0.0",
"lint-staged": "^13.0.1",
"prettier": "^2.6.2",
"lint-staged": "^13.0.2",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"ts-node": "^10.8.1",
"tsconfig-paths": "^4.0.0",
"tsconfig-paths-webpack-plugin": "^3.5.2",
"tslib": "^2.4.0",
"typescript": "^4.7.3"
"typescript": "^4.7.4"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapters/openlogin-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/lodash.merge": "^4.6.7"
},
"dependencies": {
"@toruslabs/openlogin": "^2.1.0",
"@toruslabs/openlogin": "^2.2.0",
"@toruslabs/openlogin-ed25519": "^2.0.0",
"@web3auth/base": "^1.0.1",
"@web3auth/base-provider": "^1.0.1",
Expand Down
6 changes: 5 additions & 1 deletion packages/adapters/openlogin-adapter/src/openloginAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import OpenLogin, { getHashQueryParams, LoginParams, OPENLOGIN_NETWORK, OpenLoginOptions, UX_MODE } from "@toruslabs/openlogin";
import OpenLogin, { getHashQueryParams, LoginParams, OPENLOGIN_NETWORK, OpenLoginOptions, SUPPORTED_KEY_CURVES, UX_MODE } from "@toruslabs/openlogin";
import {
ADAPTER_CATEGORY,
ADAPTER_CATEGORY_TYPE,
Expand Down Expand Up @@ -196,6 +196,10 @@ export class OpenloginAdapter extends BaseAdapter<OpenloginLoginParams> {
}
// if not logged in then login
if (!this.openloginInstance.privKey && params) {
if (!this.loginSettings.curve) {
this.loginSettings.curve =
this.currentChainNamespace === CHAIN_NAMESPACES.SOLANA ? SUPPORTED_KEY_CURVES.ED25519 : SUPPORTED_KEY_CURVES.SECP256K1;
}
await this.openloginInstance.login(
merge(
this.loginSettings,
Expand Down
2 changes: 1 addition & 1 deletion packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"ts-custom-error": "^3.2.0"
},
"devDependencies": {
"@toruslabs/openlogin": "^2.1.0"
"@toruslabs/openlogin": "^2.2.0"
},
"files": [
"dist",
Expand Down
38 changes: 2 additions & 36 deletions packages/base/src/adapter/IAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CUSTOM_LOGIN_PROVIDER_TYPE, LOGIN_PROVIDER_TYPE } from "@toruslabs/openlogin";
import type { OpenloginUserInfo } from "@toruslabs/openlogin";
import { SafeEventEmitter } from "@toruslabs/openlogin-jrpc";

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

export type UserInfo = {
/**
* Email of the logged in user
*/
email: string;
/**
* Full name of the logged in user
*/
name: string;
/**
* Profile image of the logged in user
*/
profileImage: string;
/**
* verifier of the logged in user (google, facebook etc)
*/
verifier: string;
/**
* Verifier Id of the logged in user
*
* email for google,
* id for facebook,
* username for reddit,
* id for twitch,
* id for discord
*/
verifierId: string;

aggregateVerifier?: string;

/**
* typeOfLogin of the logged in user (google, facebook etc)
*/
typeOfLogin: LOGIN_PROVIDER_TYPE | CUSTOM_LOGIN_PROVIDER_TYPE;
};
export type UserInfo = OpenloginUserInfo;

export const ADAPTER_CATEGORY = {
EXTERNAL: "external",
Expand Down
2 changes: 1 addition & 1 deletion packages/modal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"devDependencies": {
"@svgr/webpack": "^6.2.1",
"@toruslabs/openlogin": "^2.1.0",
"@toruslabs/openlogin": "^2.2.0",
"@types/node": "^16",
"css-loader": "^6.7.1",
"style-loader": "^3.3.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@babel/preset-react": "^7.17.12",
"@svgr/rollup": "^6.2.1",
"@svgr/webpack": "^6.2.1",
"@toruslabs/eslint-config-react": "^1.0.2",
"@toruslabs/eslint-config-react": "^1.0.3",
"@types/lodash.clonedeep": "^4.5.7",
"@types/lodash.merge": "^4.6.7",
"@types/react": "^17.0.43",
Expand All @@ -48,7 +48,7 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"live-server": "^1.2.2",
"postcss": "^8.4.14",
Expand All @@ -58,7 +58,7 @@
"url-loader": "^4.1.1"
},
"dependencies": {
"@toruslabs/openlogin": "^2.1.0",
"@toruslabs/openlogin": "^2.2.0",
"@toruslabs/openlogin-jrpc": "^2.1.0",
"@web3auth/base": "^1.0.1",
"bowser": "^2.11.0",
Expand Down
Loading