Skip to content

Commit fa8f1dc

Browse files
update deps
remove default export
1 parent 668d75b commit fa8f1dc

File tree

26 files changed

+94
-93
lines changed

26 files changed

+94
-93
lines changed

examples/angular-app/src/app/home/home.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit } from "@angular/core";
2-
import TorusSdk from "@toruslabs/customauth";
2+
import { CustomAuth } from "@toruslabs/customauth";
33

44
import {
55
verifierMap,
@@ -57,7 +57,7 @@ export class HomeComponent implements OnInit {
5757
queryParams[key] = url.searchParams.get(key);
5858
}
5959
const { error, instanceParameters } = this.handleRedirectParameters(hash, queryParams);
60-
const torusdirectsdk = new TorusSdk({
60+
const torusdirectsdk = new CustomAuth({
6161
baseUrl: `${window.location.origin}/serviceworker`,
6262
enableLogging: true,
6363
network: "testnet", // details for test net

examples/angular-app/src/app/popup-mode-login/popup-mode-login.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit } from "@angular/core";
2-
import TorusSdk from "@toruslabs/customauth";
2+
import { CustomAuth } from "@toruslabs/customauth";
33

44
import {
55
verifierMap,
@@ -35,7 +35,7 @@ export class PopupModeLoginComponent implements OnInit {
3535

3636
async ngOnInit() {
3737
try {
38-
const torusdirectsdk = new TorusSdk({
38+
const torusdirectsdk = new CustomAuth({
3939
baseUrl: `${location.origin}/serviceworker`,
4040
enableLogging: true,
4141
network: "testnet", // details for test net

examples/angular-app/src/app/redirect-mode-auth/redirect-mode-auth.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit } from "@angular/core";
2-
import TorusSdk from "@toruslabs/customauth";
2+
import { CustomAuth } from "@toruslabs/customauth";
33

44
@Component({
55
selector: "app-redirect-mode-auth",
@@ -10,7 +10,7 @@ export class RedirectModeAuthComponent implements OnInit {
1010
consoleText = "";
1111

1212
async ngOnInit(): Promise<void> {
13-
const torusdirectsdk = new TorusSdk({
13+
const torusdirectsdk = new CustomAuth({
1414
baseUrl: window.location.origin,
1515
redirectPathName: "auth",
1616
enableLogging: true,

examples/angular-app/src/app/redirect-mode-login/redirect-mode-login.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit } from "@angular/core";
2-
import TorusSdk, { Auth0ClientOptions } from "@toruslabs/customauth";
2+
import { CustomAuth, Auth0ClientOptions } from "@toruslabs/customauth";
33

44
import {
55
verifierMap,
@@ -25,7 +25,7 @@ import {
2525
styleUrls: ["./redirect-mode-login.component.css"],
2626
})
2727
export class RedirectModeLoginComponent implements OnInit {
28-
torusdirectsdk: TorusSdk | null = null;
28+
torusdirectsdk: CustomAuth | null = null;
2929
selectedVerifier = GOOGLE;
3030

3131
verifierMap = verifierMap;
@@ -34,7 +34,7 @@ export class RedirectModeLoginComponent implements OnInit {
3434

3535
async ngOnInit() {
3636
try {
37-
const torusdirectsdk = new TorusSdk({
37+
const torusdirectsdk = new CustomAuth({
3838
baseUrl: location.origin,
3939
redirectPathName: "auth",
4040
enableLogging: true,

examples/nextjs-app/pages/auth.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* User will be redirected to this page in redirect uxMode
33
*/
44
import React from "react";
5-
import TorusSdk, { RedirectResult } from "@toruslabs/customauth";
5+
import { CustomAuth, RedirectResult } from "@toruslabs/customauth";
66
import dynamic from "next/dynamic";
77

88
let ReactJsonView;
@@ -25,7 +25,7 @@ class RedirectAuth extends React.Component<IProps, IState> {
2525
}
2626

2727
async componentDidMount() {
28-
const torusdirectsdk = new TorusSdk({
28+
const torusdirectsdk = new CustomAuth({
2929
baseUrl: window.location.origin,
3030
redirectPathName: "auth",
3131
enableLogging: true,

examples/nextjs-app/pages/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable class-methods-use-this */
22
import React from "react";
33
import Link from "next/link";
4-
import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth";
4+
import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth";
55
import dynamic from "next/dynamic";
66

77
import {
@@ -27,7 +27,7 @@ if (typeof window === "object") {
2727

2828
interface IState {
2929
selectedVerifier: string;
30-
torusdirectsdk: TorusSdk | null;
30+
torusdirectsdk: CustomAuth | null;
3131
loginHint: string;
3232
loginResponse?: TorusLoginResponse | null;
3333
}
@@ -69,7 +69,7 @@ class HomePage extends React.PureComponent<IProps, IState> {
6969
queryParams[key] = url.searchParams.get(key);
7070
}
7171
const { error, instanceParameters } = this.handleRedirectParameters(hash, queryParams);
72-
const torusdirectsdk = new TorusSdk({
72+
const torusdirectsdk = new CustomAuth({
7373
baseUrl: `${window.location.origin}/serviceworker`,
7474
enableLogging: true,
7575
network: "testnet", // details for test net

examples/nextjs-app/pages/popupMode/login.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth";
2+
import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth";
33
import dynamic from "next/dynamic";
44
import {
55
verifierMap,
@@ -26,7 +26,7 @@ if (typeof window === "object") {
2626

2727
interface IState {
2828
selectedVerifier: string;
29-
torusdirectsdk: TorusSdk | null;
29+
torusdirectsdk: CustomAuth | null;
3030
loginHint: string;
3131
loginDetails?: TorusLoginResponse | null;
3232
}
@@ -37,15 +37,15 @@ class MyApp extends React.Component<IProps, IState> {
3737
super(props);
3838
this.state = {
3939
selectedVerifier: GOOGLE,
40-
torusdirectsdk: null as TorusSdk | null,
40+
torusdirectsdk: null as CustomAuth | null,
4141
loginHint: "",
4242
loginDetails: null,
4343
};
4444
}
4545

4646
componentDidMount = async () => {
4747
try {
48-
const torusdirectsdk = new TorusSdk({
48+
const torusdirectsdk = new CustomAuth({
4949
baseUrl: `${window.location.origin}/serviceworker`,
5050
enableLogging: true,
5151
network: "testnet", // details for test net

examples/nextjs-app/pages/redirectMode/login.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import TorusSdk, { UX_MODE } from "@toruslabs/customauth";
2+
import { CustomAuth, UX_MODE } from "@toruslabs/customauth";
33

44
import {
55
verifierMap,
@@ -21,7 +21,7 @@ import {
2121

2222
interface IState {
2323
selectedVerifier: string;
24-
torusdirectsdk: TorusSdk | null;
24+
torusdirectsdk: CustomAuth | null;
2525
loginHint: string;
2626
consoleText?: string;
2727
}
@@ -40,7 +40,7 @@ class RedirectMode extends React.Component<IProps, IState> {
4040

4141
componentDidMount = async () => {
4242
try {
43-
const torusdirectsdk = new TorusSdk({
43+
const torusdirectsdk = new CustomAuth({
4444
baseUrl: window.location.origin,
4545
// user will be redirect to auth page after login
4646
redirectPathName: "auth",

examples/react-app/src/App.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable class-methods-use-this */
22
import React from "react";
33
import { Link } from "react-router-dom";
4-
import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth";
4+
import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth";
55
import ReactJsonView from "react-json-view";
66

77
import {
@@ -22,7 +22,7 @@ import {
2222

2323
interface IState {
2424
selectedVerifier: string;
25-
torusdirectsdk: TorusSdk | null;
25+
torusdirectsdk: CustomAuth | null;
2626
loginHint: string;
2727
loginResponse?: TorusLoginResponse | null;
2828
}
@@ -65,7 +65,7 @@ class HomePage extends React.PureComponent<IProps, IState> {
6565
queryParams[key] = url.searchParams.get(key);
6666
}
6767
const { error, instanceParameters } = this.handleRedirectParameters(hash, queryParams);
68-
const torusdirectsdk = new TorusSdk({
68+
const torusdirectsdk = new CustomAuth({
6969
baseUrl: `${window.location.origin}/serviceworker`,
7070
enableLogging: true,
7171
network: "testnet", // details for test net

examples/react-app/src/popupMode/login.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import "../App.css";
3-
import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth";
3+
import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth";
44
import ReactJsonView from "react-json-view";
55
import {
66
verifierMap,
@@ -22,7 +22,7 @@ import {
2222

2323
interface IState {
2424
selectedVerifier: string;
25-
torusdirectsdk: TorusSdk | null;
25+
torusdirectsdk: CustomAuth | null;
2626
loginResponse?: TorusLoginResponse | null;
2727
}
2828

@@ -40,7 +40,7 @@ class PopupMode extends React.Component<IProps, IState> {
4040

4141
componentDidMount = async () => {
4242
try {
43-
const torusdirectsdk = new TorusSdk({
43+
const torusdirectsdk = new CustomAuth({
4444
baseUrl: `${window.location.origin}/serviceworker`,
4545
enableLogging: true,
4646
network: "testnet", // details for test net

examples/react-app/src/redirectMode/auth.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import "../App.css";
3-
import TorusSdk, { RedirectResult } from "@toruslabs/customauth";
3+
import { CustomAuth, RedirectResult } from "@toruslabs/customauth";
44
import ReactJsonView from "react-json-view";
55

66
interface IState {
@@ -18,7 +18,7 @@ class RedirectAuth extends React.Component<IProps, IState> {
1818
}
1919

2020
async componentDidMount() {
21-
const torusdirectsdk = new TorusSdk({
21+
const torusdirectsdk = new CustomAuth({
2222
baseUrl: window.location.origin,
2323
redirectPathName: "auth",
2424
enableLogging: true,

examples/react-app/src/redirectMode/login.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import "../App.css";
3-
import TorusSdk, { UX_MODE } from "@toruslabs/customauth";
3+
import { CustomAuth, UX_MODE } from "@toruslabs/customauth";
44
import {
55
verifierMap,
66
GOOGLE,
@@ -21,7 +21,7 @@ import {
2121

2222
interface IState {
2323
selectedVerifier: string;
24-
torusdirectsdk: TorusSdk | null;
24+
torusdirectsdk: CustomAuth | null;
2525
consoleText?: string;
2626
}
2727

@@ -38,7 +38,7 @@ class RedirectMode extends React.Component<IProps, IState> {
3838

3939
componentDidMount = async () => {
4040
try {
41-
const torusdirectsdk = new TorusSdk({
41+
const torusdirectsdk = new CustomAuth({
4242
baseUrl: window.location.origin,
4343
// user will be redirect to auth page after login
4444
redirectPathName: "auth",

examples/starkware-react-example/src/App.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable class-methods-use-this */
22
import React from "react";
33
import { Link } from "react-router-dom";
4-
import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth";
4+
import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth";
55
import ReactJsonView from "react-json-view";
66

77
import {
@@ -22,7 +22,7 @@ import {
2222

2323
interface IState {
2424
selectedVerifier: string;
25-
torusdirectsdk: TorusSdk | null;
25+
torusdirectsdk: CustomAuth | null;
2626
loginHint: string;
2727
loginResponse?: TorusLoginResponse | null;
2828
}
@@ -65,7 +65,7 @@ class HomePage extends React.PureComponent<IProps, IState> {
6565
queryParams[key] = url.searchParams.get(key);
6666
}
6767
const { error, instanceParameters } = this.handleRedirectParameters(hash, queryParams);
68-
const torusdirectsdk = new TorusSdk({
68+
const torusdirectsdk = new CustomAuth({
6969
baseUrl: `${window.location.origin}/serviceworker`,
7070
enableLogging: true,
7171
network: "testnet", // details for test net

examples/starkware-react-example/src/popupMode/login.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import "../App.css";
3-
import TorusSdk, { TorusLoginResponse } from "@toruslabs/customauth";
3+
import { CustomAuth, TorusLoginResponse } from "@toruslabs/customauth";
44

55
import { getStarkHDAccount, starkEc, sign, verify, pedersen, STARKNET_NETWORKS } from "@toruslabs/openlogin-starkkey";
66
import { binaryToHex, binaryToUtf8, bufferToBinary, bufferToHex, hexToBinary } from "enc-utils";
@@ -26,7 +26,7 @@ import {
2626

2727
interface IState {
2828
selectedVerifier: string;
29-
torusdirectsdk: TorusSdk | null;
29+
torusdirectsdk: CustomAuth | null;
3030
loginResponse?: TorusLoginResponse | null;
3131
signingMessage?: string | null;
3232
signedMessage?: ec.Signature | null;
@@ -48,7 +48,7 @@ class PopupMode extends React.Component<IProps, IState> {
4848

4949
componentDidMount = async () => {
5050
try {
51-
const torusdirectsdk = new TorusSdk({
51+
const torusdirectsdk = new CustomAuth({
5252
baseUrl: `${window.location.origin}/serviceworker`,
5353
enableLogging: true,
5454
network: "testnet", // details for test net

examples/starkware-react-example/src/redirectMode/auth.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import "../App.css";
3-
import TorusSdk, { RedirectResult } from "@toruslabs/customauth";
3+
import { CustomAuth, RedirectResult } from "@toruslabs/customauth";
44
import { getStarkHDAccount, starkEc, sign, verify, pedersen, STARKNET_NETWORKS } from "@toruslabs/openlogin-starkkey";
55
import { binaryToHex, binaryToUtf8, bufferToBinary, bufferToHex, hexToBinary } from "enc-utils";
66
import type { ec } from "elliptic";
@@ -24,7 +24,7 @@ class RedirectAuth extends React.Component<IProps, IState> {
2424
}
2525

2626
async componentDidMount() {
27-
const torusdirectsdk = new TorusSdk({
27+
const torusdirectsdk = new CustomAuth({
2828
baseUrl: window.location.origin,
2929
redirectPathName: "auth",
3030
enableLogging: true,
@@ -50,7 +50,7 @@ class RedirectAuth extends React.Component<IProps, IState> {
5050
const account = getStarkHDAccount(
5151
((this.state.loginDetails?.result as any)?.privateKey as string).padStart(64, "0"),
5252
index,
53-
STARKNET_NETWORKS.testnet
53+
STARKNET_NETWORKS.testnet,
5454
);
5555
return account;
5656
};

examples/starkware-react-example/src/redirectMode/login.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import "../App.css";
3-
import TorusSdk, { UX_MODE } from "@toruslabs/customauth";
3+
import { CustomAuth, UX_MODE } from "@toruslabs/customauth";
44
import {
55
verifierMap,
66
GOOGLE,
@@ -21,7 +21,7 @@ import {
2121

2222
interface IState {
2323
selectedVerifier: string;
24-
torusdirectsdk: TorusSdk | null;
24+
torusdirectsdk: CustomAuth | null;
2525
consoleText?: string;
2626
}
2727

@@ -38,7 +38,7 @@ class RedirectMode extends React.Component<IProps, IState> {
3838

3939
componentDidMount = async () => {
4040
try {
41-
const torusdirectsdk = new TorusSdk({
41+
const torusdirectsdk = new CustomAuth({
4242
baseUrl: window.location.origin,
4343
// user will be redirect to auth page after login
4444
redirectPathName: "auth",

0 commit comments

Comments
 (0)