Skip to content

Commit

Permalink
Merge pull request #40 from Web3Auth/fix/switch-chain
Browse files Browse the repository at this point in the history
Fix Switch Chain and remove log
  • Loading branch information
arch1995 authored May 17, 2024
2 parents 9750a37 + 579bb3c commit 0e1fbcb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
12 changes: 12 additions & 0 deletions example/react-app/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
background-color: #f1f1f1;
}

.passkey{
max-width: 400px;
min-width: 200px;
height: 38px;
width: 248px;
}

.footer {
display: flex;
flex: 1;
Expand Down Expand Up @@ -93,6 +100,11 @@
font-size: 30px;
}

.text{
font-size: 12px;
font-weight: 600;
}

#console {
width: 100%;
height: 100%;
Expand Down
15 changes: 12 additions & 3 deletions example/react-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ function App() {
}
setIsLoggingIn(true);
const idToken = response.credential;
console.log(idToken);
if (!idToken) {
setIsLoggingIn(false);
return;
Expand Down Expand Up @@ -159,7 +158,7 @@ function App() {
uiConsole("provider not initialized yet");
return;
}
await web3authSFAuth?.switchChain({ chainId: "0x5" });
await web3authSFAuth?.switchChain({ chainId: "0x13882" });
uiConsole("Chain Switched");
};

Expand Down Expand Up @@ -348,9 +347,19 @@ function App() {
<>
<GoogleLogin onSuccess={onSuccess} useOneTap />
</>
<button onClick={loginWithPasskey} className="card">
<button onClick={loginWithPasskey} className="card passkey">
Login with Passkey
</button>
<>
<div className="flex-container text">
<p>Steps:</p>
<ol>
<li>Click on the Sign in with Google or use Google One Tap</li>
<li>Once logged in, Register the Passkey, then logout</li>
<li>Click on the "Login with Passkey" button to experience the Passkey login.</li>
</ol>
</div>
</>
</>
);

Expand Down

0 comments on commit 0e1fbcb

Please sign in to comment.