Created
November 16, 2020 01:56
-
-
Save alancasagrande/0bbef52b2483741800511519636e70eb to your computer and use it in GitHub Desktop.
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
import React, { useCallback, useState } from 'react'; | |
import Login from './Login'; | |
import OneTimePassword from './OneTimePassword'; | |
export default function App({ user }) { | |
// user not logged in, show login form | |
if (!user) return <Login />; | |
return ( | |
<div> | |
<p> | |
Hello, {user.username}. <a href="/logout">Logout</a> | |
</p> | |
{user.mfaEnabled ? ( | |
<p>Confratulations, multi factor authentication is enabled.</p> | |
) : ( | |
<OneTimePassword /> | |
)} | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment