Skip to content

Commit 2c03792

Browse files
authored
fix dashboard 2fa flow (#1874)
1 parent 84985a6 commit 2c03792

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/components/Faucet/Hero.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default function Hero({
3535
walletLinked,
3636
projects,
3737
walletAuthUrl,
38+
needsMfa,
3839
} = useContext(MetamaskProviderContext);
3940

4041
const isMobile = sdk.platformManager?.isMobile ?? false;
@@ -100,7 +101,7 @@ export default function Hero({
100101
className,
101102
)}
102103
>
103-
{(showInstallButton || !(metaMaskAccount)) && <EthIcon />}
104+
<EthIcon />
104105
<Text as="h1">
105106
<span>
106107
{network === "linea" && "Linea Sepolia"}
@@ -112,7 +113,7 @@ export default function Hero({
112113
{showInstallButton
113114
? "Install MetaMask for your browser to get started and request ETH."
114115
: !Object.keys(projects).length
115-
? walletLinked === undefined
116+
? needsMfa ? "Your Infura Account requires 2-Factor Authentication" : walletLinked === undefined
116117
? "Connect your MetaMask wallet to get started and request ETH."
117118
: walletLinked === WALLET_LINK_TYPE.NO
118119
? "Link your Infura account to get started and request ETH."
@@ -154,6 +155,15 @@ export default function Hero({
154155
</Button>
155156
) : !Object.keys(projects).length ? (
156157
<>
158+
{needsMfa ?
159+
<Button
160+
testId="hero-cta-enter-mfa"
161+
className={styles.button}
162+
onClick={() => (window.location.href = walletAuthUrl)}
163+
>
164+
Authenticate
165+
</Button>
166+
: <>
157167
{walletLinked === undefined && (
158168
<Button
159169
testId="hero-cta-connect-metamask"
@@ -184,6 +194,8 @@ export default function Hero({
184194
Select Infura Account
185195
</Button>
186196
)}
197+
</>
198+
}
187199
</>
188200
) : (
189201
<Button

0 commit comments

Comments
 (0)