Skip to content

Commit dfbcce6

Browse files
committed
add enableMFA()
1 parent c8db87c commit dfbcce6

File tree

1 file changed

+17
-5
lines changed
  • web-no-modal-sdk/custom-authentication/single-verifier-examples/auth0-no-modal-example/src

1 file changed

+17
-5
lines changed

web-no-modal-sdk/custom-authentication/single-verifier-examples/auth0-no-modal-example/src/App.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ function App() {
4141
verifier: "w3a-auth0-demo",
4242
typeOfLogin: "jwt",
4343
clientId: "hUVVf4SEsZT7syOiL0gLU9hFEtm2gQ6O",
44+
jwtParameters: {
45+
domain: "https://web3auth.au.auth0.com",
46+
verifierIdField: "sub",
47+
},
4448
},
4549
},
4650
mfaSettings: {
@@ -91,11 +95,6 @@ function App() {
9195
}
9296
const web3authProvider = await web3auth.connectTo(WALLET_ADAPTERS.AUTH, {
9397
loginProvider: "jwt",
94-
extraLoginOptions: {
95-
domain: "https://web3auth.au.auth0.com",
96-
verifierIdField: "email",
97-
// connection: "google-oauth2", // Use this to skip Auth0 Modal for Google login.
98-
},
9998
});
10099
setProvider(web3authProvider);
101100
};
@@ -128,6 +127,14 @@ function App() {
128127
setProvider(null);
129128
};
130129

130+
const enableMfa = async () => {
131+
if (!web3auth) {
132+
uiConsole("web3auth not initialized yet");
133+
return;
134+
}
135+
await web3auth.enableMFA();
136+
};
137+
131138
const getChainId = async () => {
132139
if (!provider) {
133140
uiConsole("provider not initialized yet");
@@ -232,6 +239,11 @@ function App() {
232239
Send Transaction
233240
</button>
234241
</div>
242+
<div>
243+
<button onClick={enableMfa} className="card">
244+
Enable MFA
245+
</button>
246+
</div>
235247
<div>
236248
<button onClick={getPrivateKey} className="card">
237249
Get Private Key

0 commit comments

Comments
 (0)