diff --git a/examples/angular-app/src/app/home/home.component.ts b/examples/angular-app/src/app/home/home.component.ts index 916d9b1e..7c5f75b1 100644 --- a/examples/angular-app/src/app/home/home.component.ts +++ b/examples/angular-app/src/app/home/home.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import TorusSdk from "@toruslabs/customauth"; +import { CustomAuth } from "@toruslabs/customauth"; import { verifierMap, @@ -57,7 +57,7 @@ export class HomeComponent implements OnInit { queryParams[key] = url.searchParams.get(key); } const { error, instanceParameters } = this.handleRedirectParameters(hash, queryParams); - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: `${window.location.origin}/serviceworker`, enableLogging: true, network: "testnet", // details for test net diff --git a/examples/angular-app/src/app/popup-mode-login/popup-mode-login.component.ts b/examples/angular-app/src/app/popup-mode-login/popup-mode-login.component.ts index f77f6767..b06fcf7c 100644 --- a/examples/angular-app/src/app/popup-mode-login/popup-mode-login.component.ts +++ b/examples/angular-app/src/app/popup-mode-login/popup-mode-login.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import TorusSdk from "@toruslabs/customauth"; +import { CustomAuth } from "@toruslabs/customauth"; import { verifierMap, @@ -35,7 +35,7 @@ export class PopupModeLoginComponent implements OnInit { async ngOnInit() { try { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: `${location.origin}/serviceworker`, enableLogging: true, network: "testnet", // details for test net diff --git a/examples/angular-app/src/app/redirect-mode-auth/redirect-mode-auth.component.ts b/examples/angular-app/src/app/redirect-mode-auth/redirect-mode-auth.component.ts index 1e040a7d..8efec3a6 100644 --- a/examples/angular-app/src/app/redirect-mode-auth/redirect-mode-auth.component.ts +++ b/examples/angular-app/src/app/redirect-mode-auth/redirect-mode-auth.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import TorusSdk from "@toruslabs/customauth"; +import { CustomAuth } from "@toruslabs/customauth"; @Component({ selector: "app-redirect-mode-auth", @@ -10,7 +10,7 @@ export class RedirectModeAuthComponent implements OnInit { consoleText = ""; async ngOnInit(): Promise { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: window.location.origin, redirectPathName: "auth", enableLogging: true, diff --git a/examples/angular-app/src/app/redirect-mode-login/redirect-mode-login.component.ts b/examples/angular-app/src/app/redirect-mode-login/redirect-mode-login.component.ts index 9a94ed03..11f4b823 100644 --- a/examples/angular-app/src/app/redirect-mode-login/redirect-mode-login.component.ts +++ b/examples/angular-app/src/app/redirect-mode-login/redirect-mode-login.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit } from "@angular/core"; -import TorusSdk, { Auth0ClientOptions } from "@toruslabs/customauth"; +import { CustomAuth, Auth0ClientOptions } from "@toruslabs/customauth"; import { verifierMap, @@ -25,7 +25,7 @@ import { styleUrls: ["./redirect-mode-login.component.css"], }) export class RedirectModeLoginComponent implements OnInit { - torusdirectsdk: TorusSdk | null = null; + torusdirectsdk: CustomAuth | null = null; selectedVerifier = GOOGLE; verifierMap = verifierMap; @@ -34,7 +34,7 @@ export class RedirectModeLoginComponent implements OnInit { async ngOnInit() { try { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: location.origin, redirectPathName: "auth", enableLogging: true, diff --git a/examples/nextjs-app/pages/auth.tsx b/examples/nextjs-app/pages/auth.tsx index 9d6ce16e..9796c979 100644 --- a/examples/nextjs-app/pages/auth.tsx +++ b/examples/nextjs-app/pages/auth.tsx @@ -2,7 +2,7 @@ * User will be redirected to this page in redirect uxMode */ import React from "react"; -import TorusSdk, { RedirectResult } from "@toruslabs/customauth"; +import { CustomAuth, RedirectResult } from "@toruslabs/customauth"; import dynamic from "next/dynamic"; let ReactJsonView; @@ -25,7 +25,7 @@ class RedirectAuth extends React.Component { } async componentDidMount() { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: window.location.origin, redirectPathName: "auth", enableLogging: true, diff --git a/examples/nextjs-app/pages/index.tsx b/examples/nextjs-app/pages/index.tsx index 8f7ed1ba..608fdfad 100644 --- a/examples/nextjs-app/pages/index.tsx +++ b/examples/nextjs-app/pages/index.tsx @@ -1,7 +1,7 @@ /* eslint-disable class-methods-use-this */ import React from "react"; import Link from "next/link"; -import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth"; +import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth"; import dynamic from "next/dynamic"; import { @@ -27,7 +27,7 @@ if (typeof window === "object") { interface IState { selectedVerifier: string; - torusdirectsdk: TorusSdk | null; + torusdirectsdk: CustomAuth | null; loginHint: string; loginResponse?: TorusLoginResponse | null; } @@ -69,7 +69,7 @@ class HomePage extends React.PureComponent { queryParams[key] = url.searchParams.get(key); } const { error, instanceParameters } = this.handleRedirectParameters(hash, queryParams); - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: `${window.location.origin}/serviceworker`, enableLogging: true, network: "testnet", // details for test net diff --git a/examples/nextjs-app/pages/popupMode/login.tsx b/examples/nextjs-app/pages/popupMode/login.tsx index 62457a8e..8ab778e0 100644 --- a/examples/nextjs-app/pages/popupMode/login.tsx +++ b/examples/nextjs-app/pages/popupMode/login.tsx @@ -1,5 +1,5 @@ import React from "react"; -import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth"; +import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth"; import dynamic from "next/dynamic"; import { verifierMap, @@ -26,7 +26,7 @@ if (typeof window === "object") { interface IState { selectedVerifier: string; - torusdirectsdk: TorusSdk | null; + torusdirectsdk: CustomAuth | null; loginHint: string; loginDetails?: TorusLoginResponse | null; } @@ -37,7 +37,7 @@ class MyApp extends React.Component { super(props); this.state = { selectedVerifier: GOOGLE, - torusdirectsdk: null as TorusSdk | null, + torusdirectsdk: null as CustomAuth | null, loginHint: "", loginDetails: null, }; @@ -45,7 +45,7 @@ class MyApp extends React.Component { componentDidMount = async () => { try { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: `${window.location.origin}/serviceworker`, enableLogging: true, network: "testnet", // details for test net diff --git a/examples/nextjs-app/pages/redirectMode/login.tsx b/examples/nextjs-app/pages/redirectMode/login.tsx index e260e9f1..aa33c9ae 100644 --- a/examples/nextjs-app/pages/redirectMode/login.tsx +++ b/examples/nextjs-app/pages/redirectMode/login.tsx @@ -1,5 +1,5 @@ import React from "react"; -import TorusSdk, { UX_MODE } from "@toruslabs/customauth"; +import { CustomAuth, UX_MODE } from "@toruslabs/customauth"; import { verifierMap, @@ -21,7 +21,7 @@ import { interface IState { selectedVerifier: string; - torusdirectsdk: TorusSdk | null; + torusdirectsdk: CustomAuth | null; loginHint: string; consoleText?: string; } @@ -40,7 +40,7 @@ class RedirectMode extends React.Component { componentDidMount = async () => { try { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: window.location.origin, // user will be redirect to auth page after login redirectPathName: "auth", diff --git a/examples/react-app/src/App.tsx b/examples/react-app/src/App.tsx index 300ddf2f..4e5b72c4 100644 --- a/examples/react-app/src/App.tsx +++ b/examples/react-app/src/App.tsx @@ -1,7 +1,7 @@ /* eslint-disable class-methods-use-this */ import React from "react"; import { Link } from "react-router-dom"; -import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth"; +import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth"; import ReactJsonView from "react-json-view"; import { @@ -22,7 +22,7 @@ import { interface IState { selectedVerifier: string; - torusdirectsdk: TorusSdk | null; + torusdirectsdk: CustomAuth | null; loginHint: string; loginResponse?: TorusLoginResponse | null; } @@ -65,7 +65,7 @@ class HomePage extends React.PureComponent { queryParams[key] = url.searchParams.get(key); } const { error, instanceParameters } = this.handleRedirectParameters(hash, queryParams); - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: `${window.location.origin}/serviceworker`, enableLogging: true, network: "testnet", // details for test net diff --git a/examples/react-app/src/popupMode/login.tsx b/examples/react-app/src/popupMode/login.tsx index 2de4d44c..602ce48b 100644 --- a/examples/react-app/src/popupMode/login.tsx +++ b/examples/react-app/src/popupMode/login.tsx @@ -1,6 +1,6 @@ import React from "react"; import "../App.css"; -import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth"; +import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth"; import ReactJsonView from "react-json-view"; import { verifierMap, @@ -22,7 +22,7 @@ import { interface IState { selectedVerifier: string; - torusdirectsdk: TorusSdk | null; + torusdirectsdk: CustomAuth | null; loginResponse?: TorusLoginResponse | null; } @@ -40,7 +40,7 @@ class PopupMode extends React.Component { componentDidMount = async () => { try { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: `${window.location.origin}/serviceworker`, enableLogging: true, network: "testnet", // details for test net diff --git a/examples/react-app/src/redirectMode/auth.tsx b/examples/react-app/src/redirectMode/auth.tsx index 0c7a6d9f..7967cd9b 100644 --- a/examples/react-app/src/redirectMode/auth.tsx +++ b/examples/react-app/src/redirectMode/auth.tsx @@ -1,6 +1,6 @@ import React from "react"; import "../App.css"; -import TorusSdk, { RedirectResult } from "@toruslabs/customauth"; +import { CustomAuth, RedirectResult } from "@toruslabs/customauth"; import ReactJsonView from "react-json-view"; interface IState { @@ -18,7 +18,7 @@ class RedirectAuth extends React.Component { } async componentDidMount() { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: window.location.origin, redirectPathName: "auth", enableLogging: true, diff --git a/examples/react-app/src/redirectMode/login.tsx b/examples/react-app/src/redirectMode/login.tsx index a61661d0..bbf1e02b 100644 --- a/examples/react-app/src/redirectMode/login.tsx +++ b/examples/react-app/src/redirectMode/login.tsx @@ -1,6 +1,6 @@ import React from "react"; import "../App.css"; -import TorusSdk, { UX_MODE } from "@toruslabs/customauth"; +import { CustomAuth, UX_MODE } from "@toruslabs/customauth"; import { verifierMap, GOOGLE, @@ -21,7 +21,7 @@ import { interface IState { selectedVerifier: string; - torusdirectsdk: TorusSdk | null; + torusdirectsdk: CustomAuth | null; consoleText?: string; } @@ -38,7 +38,7 @@ class RedirectMode extends React.Component { componentDidMount = async () => { try { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: window.location.origin, // user will be redirect to auth page after login redirectPathName: "auth", diff --git a/examples/starkware-react-example/src/App.tsx b/examples/starkware-react-example/src/App.tsx index 300ddf2f..4e5b72c4 100644 --- a/examples/starkware-react-example/src/App.tsx +++ b/examples/starkware-react-example/src/App.tsx @@ -1,7 +1,7 @@ /* eslint-disable class-methods-use-this */ import React from "react"; import { Link } from "react-router-dom"; -import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth"; +import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth"; import ReactJsonView from "react-json-view"; import { @@ -22,7 +22,7 @@ import { interface IState { selectedVerifier: string; - torusdirectsdk: TorusSdk | null; + torusdirectsdk: CustomAuth | null; loginHint: string; loginResponse?: TorusLoginResponse | null; } @@ -65,7 +65,7 @@ class HomePage extends React.PureComponent { queryParams[key] = url.searchParams.get(key); } const { error, instanceParameters } = this.handleRedirectParameters(hash, queryParams); - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: `${window.location.origin}/serviceworker`, enableLogging: true, network: "testnet", // details for test net diff --git a/examples/starkware-react-example/src/popupMode/login.tsx b/examples/starkware-react-example/src/popupMode/login.tsx index 2d8098ba..577711f4 100644 --- a/examples/starkware-react-example/src/popupMode/login.tsx +++ b/examples/starkware-react-example/src/popupMode/login.tsx @@ -1,6 +1,6 @@ import React from "react"; import "../App.css"; -import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth"; +import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth"; import { getStarkHDAccount, starkEc, sign, verify, pedersen, STARKNET_NETWORKS } from "@toruslabs/openlogin-starkkey"; import { binaryToHex, binaryToUtf8, bufferToBinary, bufferToHex, hexToBinary } from "enc-utils"; @@ -26,7 +26,7 @@ import { interface IState { selectedVerifier: string; - torusdirectsdk: TorusSdk | null; + torusdirectsdk: CustomAuth | null; loginResponse?: TorusLoginResponse | null; signingMessage?: string | null; signedMessage?: ec.Signature | null; @@ -48,7 +48,7 @@ class PopupMode extends React.Component { componentDidMount = async () => { try { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: `${window.location.origin}/serviceworker`, enableLogging: true, network: "testnet", // details for test net diff --git a/examples/starkware-react-example/src/redirectMode/auth.tsx b/examples/starkware-react-example/src/redirectMode/auth.tsx index ae7b24e0..974932d6 100644 --- a/examples/starkware-react-example/src/redirectMode/auth.tsx +++ b/examples/starkware-react-example/src/redirectMode/auth.tsx @@ -1,6 +1,6 @@ import React from "react"; import "../App.css"; -import TorusSdk, { RedirectResult } from "@toruslabs/customauth"; +import { CustomAuth, RedirectResult } from "@toruslabs/customauth"; import { getStarkHDAccount, starkEc, sign, verify, pedersen, STARKNET_NETWORKS } from "@toruslabs/openlogin-starkkey"; import { binaryToHex, binaryToUtf8, bufferToBinary, bufferToHex, hexToBinary } from "enc-utils"; import type { ec } from "elliptic"; @@ -24,7 +24,7 @@ class RedirectAuth extends React.Component { } async componentDidMount() { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: window.location.origin, redirectPathName: "auth", enableLogging: true, @@ -50,7 +50,7 @@ class RedirectAuth extends React.Component { const account = getStarkHDAccount( ((this.state.loginDetails?.result as any)?.privateKey as string).padStart(64, "0"), index, - STARKNET_NETWORKS.testnet + STARKNET_NETWORKS.testnet, ); return account; }; diff --git a/examples/starkware-react-example/src/redirectMode/login.tsx b/examples/starkware-react-example/src/redirectMode/login.tsx index 2b3e1238..79a8e47e 100644 --- a/examples/starkware-react-example/src/redirectMode/login.tsx +++ b/examples/starkware-react-example/src/redirectMode/login.tsx @@ -1,6 +1,6 @@ import React from "react"; import "../App.css"; -import TorusSdk, { UX_MODE } from "@toruslabs/customauth"; +import { CustomAuth, UX_MODE } from "@toruslabs/customauth"; import { verifierMap, GOOGLE, @@ -21,7 +21,7 @@ import { interface IState { selectedVerifier: string; - torusdirectsdk: TorusSdk | null; + torusdirectsdk: CustomAuth | null; consoleText?: string; } @@ -38,7 +38,7 @@ class RedirectMode extends React.Component { componentDidMount = async () => { try { - const torusdirectsdk = new TorusSdk({ + const torusdirectsdk = new CustomAuth({ baseUrl: window.location.origin, // user will be redirect to auth page after login redirectPathName: "auth", diff --git a/examples/vue-app/package-lock.json b/examples/vue-app/package-lock.json index d52d2690..e56094f6 100644 --- a/examples/vue-app/package-lock.json +++ b/examples/vue-app/package-lock.json @@ -43,18 +43,18 @@ }, "../..": { "name": "@toruslabs/customauth", - "version": "18.1.0", + "version": "19.0.2", "license": "MIT", "dependencies": { "@chaitanyapotti/register-service-worker": "^1.7.4", "@toruslabs/broadcast-channel": "^11.0.0", "@toruslabs/constants": "^14.0.0", "@toruslabs/eccrypto": "^5.0.4", - "@toruslabs/fetch-node-details": "^14.0.0", + "@toruslabs/fetch-node-details": "^14.0.1", "@toruslabs/http-helpers": "^7.0.0", "@toruslabs/metadata-helpers": "^6.0.0", "@toruslabs/session-manager": "^1.0.0", - "@toruslabs/torus.js": "^14.0.0", + "@toruslabs/torus.js": "^14.0.1", "base64url": "^3.0.1", "bowser": "^2.11.0", "deepmerge": "^4.3.1", @@ -62,15 +62,15 @@ "loglevel": "^1.9.1" }, "devDependencies": { - "@sentry/types": "^8.16.0", + "@sentry/types": "^8.17.0", "@toruslabs/config": "^2.1.0", "@toruslabs/eslint-config-typescript": "^3.3.1", "@toruslabs/torus-scripts": "^6.0.1", "eslint": "^8.57.0", "husky": "^9.0.11", "lint-staged": "^15.2.7", - "prettier": "^3.3.2", - "rimraf": "^6.0.0", + "prettier": "^3.3.3", + "rimraf": "^6.0.1", "typescript": "^5.5.3" }, "engines": { diff --git a/examples/vue-app/src/HomePage.vue b/examples/vue-app/src/HomePage.vue index bea0701d..950ccbc4 100644 --- a/examples/vue-app/src/HomePage.vue +++ b/examples/vue-app/src/HomePage.vue @@ -13,7 +13,7 @@