Skip to content

Commit

Permalink
Merge branch 'master' of github.com:torusresearch/OpenLoginSdk into v7
Browse files Browse the repository at this point in the history
  • Loading branch information
arch1995 committed Jan 25, 2024
2 parents a1cbcb8 + f08d3d3 commit d4e8a4a
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 39 deletions.
10 changes: 1 addition & 9 deletions examples/vue-example/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,7 @@ body,
margin-bottom: -16px;
}

.mpc {
display: flex;
align-items: center;
column-gap: 16px;
margin-top: 24px;
margin-bottom: -16px;
}

.mfa {
.mpc, .wallet-key, .mfa {
display: flex;
align-items: center;
column-gap: 16px;
Expand Down
17 changes: 11 additions & 6 deletions examples/vue-example/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<label for="mfa">Enable All MFA Factors</label>
<input type="checkbox" id="mfa" name="mfa" v-model="enableAllFactors" />
</div>
<div class="wallet-key">
<label for="mpc">Enable Wallet Key</label>
<input type="checkbox" id="walletKey" name="walletKey" v-model="useWalletKey" />
</div>
<select v-model="selectedBuildEnv" class="select">
<option :key="login" v-for="login in Object.values(BUILD_ENV)" :value="login">{{ login }}</option>
</select>
Expand Down Expand Up @@ -176,6 +180,7 @@ const vueapp = defineComponent({
BUILD_ENV: BUILD_ENV,
selectedOpenloginNetwork: OPENLOGIN_NETWORK.SAPPHIRE_DEVNET as OPENLOGIN_NETWORK_TYPE,
useMpc: false,
useWalletKey: false,
selectedBuildEnv: BUILD_ENV.PRODUCTION,
emailFlowType: EMAIL_FLOW.code,
EMAIL_FLOW: EMAIL_FLOW,
Expand Down Expand Up @@ -205,8 +210,8 @@ const vueapp = defineComponent({
this.openloginInstance.options.useMpc = true;
await this.openloginInstance.init();
}
if (this.openloginInstance.privKey || this.openloginInstance.state.factorKey) {
this.privKey = this.openloginInstance.privKey || (this.openloginInstance.state.factorKey as string);
if (this.openloginInstance.privKey || this.openloginInstance.state.factorKey || this.openloginInstance.state.walletKey) {
this.privKey = this.openloginInstance.privKey || (this.openloginInstance.state.factorKey as string) || (this.openloginInstance.state.walletKey as string);
await this.setProvider(this.privKey);
}
this.loading = false;
Expand Down Expand Up @@ -291,7 +296,7 @@ const vueapp = defineComponent({
const openLoginObj: LoginParams = {
loginProvider: this.selectedLoginProvider,
mfaLevel: "optional",
getWalletKey: this.useWalletKey,
// pass empty string '' as loginProvider to open default torus modal
// with all default supported login providers or you can pass specific
// login provider from available list to set as default.
Expand Down Expand Up @@ -321,9 +326,9 @@ const vueapp = defineComponent({
}
console.log(openLoginObj, "OPENLOGIN");
const data = await this.openloginInstance.login(openLoginObj);
if (data && data.privKey) {
this.privKey = data.privKey;
await this.openloginInstance.login(openLoginObj);
if (this.openloginInstance.privKey || this.openloginInstance.state.walletKey) {
this.privKey = this.openloginInstance.privKey || (this.openloginInstance.state.walletKey || "");
await this.setProvider(this.privKey);
}
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "6.2.2",
"version": "6.2.5",
"npmClient": "npm"
}
18 changes: 9 additions & 9 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions packages/openlogin-jrpc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toruslabs/openlogin-jrpc",
"version": "6.2.2",
"version": "6.2.5",
"homepage": "https://github.com/torusresearch/OpenLoginSdk#readme",
"license": "ISC",
"main": "dist/openloginJrpc.cjs.js",
Expand All @@ -21,7 +21,7 @@
},
"dependencies": {
"@metamask/rpc-errors": "^6.1.0",
"@toruslabs/openlogin-utils": "^6.2.2",
"@toruslabs/openlogin-utils": "^6.2.5",
"end-of-stream": "^1.4.4",
"events": "^3.3.0",
"fast-safe-stringify": "^2.1.1",
Expand Down
4 changes: 3 additions & 1 deletion packages/openlogin-jrpc/src/jrpcEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class JRPCEngine extends SafeEventEmitter {
/**
* Runs an individual middleware.
*
* @returns An array of any error encountered during middleware exection,
* @returns An array of any error encountered during middleware execution,
* and a boolean indicating whether the request should end.
*/
private static _runMiddleware(
Expand Down Expand Up @@ -399,6 +399,8 @@ export function providerFromEngine(engine: JRPCEngine): SafeEventEmitterProvider
fallbackError: {
message: res.error?.message || res.error.toString(),
code: res.error?.code || -32603,
stack: res.error?.stack,
data: res.error?.data,
},
shouldIncludeStack: true,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/openlogin-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toruslabs/openlogin-utils",
"version": "6.2.2",
"version": "6.2.5",
"homepage": "https://github.com/torusresearch/OpenLoginSdk#readme",
"license": "ISC",
"main": "dist/openloginUtils.cjs.js",
Expand Down
8 changes: 4 additions & 4 deletions packages/openlogin-utils/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export const LANGUAGES = {
fr: "fr",
pt: "pt",
nl: "nl",
tk: "tk",
tr: "tr",
} as const;

export type LANGUAGE_TYPE = (typeof LANGUAGES)[keyof typeof LANGUAGES];
Expand All @@ -255,7 +255,7 @@ export const THEME_MODES = {
light: "light",
dark: "dark",
auto: "auto",
};
} as const;

export type THEME_MODE_TYPE = (typeof THEME_MODES)[keyof typeof THEME_MODES];

Expand Down Expand Up @@ -287,7 +287,7 @@ export type WhiteLabelData = {
* fr: french
* pt: portuguese
* nl: dutch
* tk: turkish
* tr: turkish
*
* @defaultValue en
*/
Expand Down Expand Up @@ -652,7 +652,7 @@ export type OpenLoginOptions = {
storageServerUrl?: string;

/**
* setting to "local" will persist social login session accross browser tabs.
* setting to "local" will persist social login session across browser tabs.
*
* @defaultValue "local"
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/openlogin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@toruslabs/openlogin",
"version": "6.2.2",
"version": "6.2.5",
"homepage": "https://github.com/torusresearch/OpenLoginSdk#readme",
"license": "ISC",
"main": "dist/openlogin.cjs.js",
Expand All @@ -23,7 +23,7 @@
"@toruslabs/eccrypto": "^4.0.0",
"@toruslabs/metadata-helpers": "^5.0.0",
"@toruslabs/openlogin-session-manager": "^3.0.0",
"@toruslabs/openlogin-utils": "^6.2.2",
"@toruslabs/openlogin-utils": "^6.2.5",
"@toruslabs/secure-pub-sub": "^0.0.1",
"bowser": "^2.11.0",
"events": "^3.3.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/wrapper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openlogin",
"version": "6.2.2",
"version": "6.2.5",
"homepage": "https://github.com/torusresearch/OpenLoginSdk#readme",
"license": "ISC",
"main": "dist/openlogin.cjs.js",
Expand All @@ -20,9 +20,9 @@
"pre-commit": "lint-staged --cwd ."
},
"dependencies": {
"@toruslabs/openlogin": "^6.2.2",
"@toruslabs/openlogin-jrpc": "^6.2.2",
"@toruslabs/openlogin-utils": "^6.2.2"
"@toruslabs/openlogin": "^6.2.5",
"@toruslabs/openlogin-jrpc": "^6.2.5",
"@toruslabs/openlogin-utils": "^6.2.5"
},
"peerDependencies": {
"@babel/runtime": "7.x"
Expand Down

0 comments on commit d4e8a4a

Please sign in to comment.