Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/mpcCoreKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,18 @@ export class Web3AuthMPCCoreKit implements ICoreKit {
return this.tKey.getTSSPub();
}

public async isMFAEnabled(): Promise<boolean> {
if (!this.state.oAuthKey || !this.options.hashedFactorNonce) {
throw new Error("oAuthKey or hashedFactorNonce not present");
}

const hashedFactorKey = getHashedPrivateKey(this.state.oAuthKey, this.options.hashedFactorNonce);
if (await this.checkIfFactorKeyValid(hashedFactorKey)) {
return true;
}
return false;
}

public async enableMFA(enableMFAParams: EnableMFAParams, recoveryFactor = true): Promise<string> {
this.checkReady();

Expand Down