-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/updateNodeDetails'
- Loading branch information
Showing
1 changed file
with
3 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ import { KEY_TYPE, SIGNER_MAP } from "@toruslabs/constants"; | |
import { AGGREGATE_VERIFIER, TORUS_METHOD, TorusAggregateLoginResponse, TorusLoginResponse, UX_MODE } from "@toruslabs/customauth"; | ||
import type { UX_MODE_TYPE } from "@toruslabs/customauth/dist/types/utils/enums"; | ||
import { Ed25519Curve } from "@toruslabs/elliptic-wrapper"; | ||
import { NodeDetailManager } from "@toruslabs/fetch-node-details"; | ||
import { fetchLocalConfig } from "@toruslabs/fnd-base"; | ||
import { keccak256 } from "@toruslabs/metadata-helpers"; | ||
import { SessionManager } from "@toruslabs/session-manager"; | ||
|
@@ -85,8 +84,6 @@ export class Web3AuthMPCCoreKit implements ICoreKit { | |
|
||
private currentStorage: AsyncStorage; | ||
|
||
private nodeDetailManager!: NodeDetailManager; | ||
|
||
private _storageBaseKey = "corekit_store"; | ||
|
||
private enableLogging = false; | ||
|
@@ -132,11 +129,6 @@ export class Web3AuthMPCCoreKit implements ICoreKit { | |
this.options = options as Web3AuthOptionsWithDefaults; | ||
|
||
this.currentStorage = new AsyncStorage(this._storageBaseKey, options.storage); | ||
|
||
this.nodeDetailManager = new NodeDetailManager({ | ||
network: this.options.web3AuthNetwork, | ||
enableLogging: options.enableLogging, | ||
}); | ||
} | ||
|
||
get tKey(): TKeyTSS { | ||
|
@@ -232,11 +224,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { | |
this.resetState(); | ||
if (params.rehydrate === undefined) params.rehydrate = true; | ||
|
||
const nodeDetails = await this.nodeDetailManager.getNodeDetails({ verifier: "test-verifier", verifierId: "[email protected]" }); | ||
|
||
if (!nodeDetails) { | ||
throw CoreKitError.nodeDetailsRetrievalFailed(); | ||
} | ||
const nodeDetails = fetchLocalConfig(this.options.web3AuthNetwork, this.keyType); | ||
|
||
if (this.keyType === KEY_TYPE.ED25519 && this.options.useDKG) { | ||
throw CoreKitError.invalidConfig("DKG is not supported for ed25519 key type"); | ||
|
@@ -296,6 +284,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { | |
(window?.location.hash.includes("#state") || window?.location.hash.includes("#access_token")) | ||
) { | ||
// on failed redirect, instance is reseted. | ||
// skip check feature gating on redirection as it was check before login | ||
await this.handleRedirectResult(); | ||
// if not redirect flow try to rehydrate session if available | ||
} else if (params.rehydrate && this.sessionManager.sessionId) { | ||
|
@@ -1264,10 +1253,7 @@ export class Web3AuthMPCCoreKit implements ICoreKit { | |
const { tssShareIndex } = this.state; | ||
const tssPubKey = await this.getPubKeyPoint(); | ||
|
||
const { torusNodeTSSEndpoints } = await this.nodeDetailManager.getNodeDetails({ | ||
verifier: this.tkey.serviceProvider.verifierName, | ||
verifierId: this.tkey.serviceProvider.verifierId, | ||
}); | ||
const { torusNodeTSSEndpoints } = fetchLocalConfig(this.options.web3AuthNetwork, this.keyType); | ||
|
||
if (!this.state.factorKey) { | ||
throw CoreKitError.factorKeyNotPresent("factorKey not present in state when signing."); | ||
|