Skip to content

Commit

Permalink
Merge pull request #349 from torusresearch/feat/use-dkg-flag
Browse files Browse the repository at this point in the history
add a flag to generate key with or without dkg
  • Loading branch information
chaitanyapotti authored Aug 20, 2024
2 parents 21431d2 + 258d8d2 commit 523c26c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/handlers/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,13 @@ export interface CustomAuthArgs {
sentry?: Sentry;

keyType?: KeyType;

/**
* Set this flag to false to generate keys on client side
* by default keys are generated on using dkg protocol on a distributed network
* @defaultValue undefined
*/
useDkg?: boolean;
}

export interface InitParams {
Expand Down
4 changes: 4 additions & 0 deletions src/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class CustomAuth {
uxMode: UX_MODE_TYPE;
locationReplaceOnRedirect: boolean;
popupFeatures: string;
useDkg?: boolean;
};

torus: Torus;
Expand All @@ -63,6 +64,7 @@ class CustomAuth {
sentry,
enableOneKey = false,
web3AuthClientId,
useDkg,
metadataUrl = "https://metadata.tor.us",
keyType = "secp256k1",
serverTimeOffset = 0,
Expand All @@ -80,6 +82,7 @@ class CustomAuth {
uxMode,
locationReplaceOnRedirect,
popupFeatures,
useDkg,
};
const torus = new Torus({
network,
Expand Down Expand Up @@ -382,6 +385,7 @@ class CustomAuth {
extraParams: {
...additionalParams,
},
useDkg: this.config.useDkg,
});
}
);
Expand Down

0 comments on commit 523c26c

Please sign in to comment.