Created
July 14, 2022 06:03
-
-
Save Joshscorp/8b67298fd22de97fb49002053c74d5a9 to your computer and use it in GitHub Desktop.
OnzAuth App Js UI
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
return ( | |
<div className="wrapper"> | |
<h1>Application</h1> | |
<button onClick={() => { | |
if (isLoggingIn) { | |
handleCancelLogin(); | |
return; | |
} | |
if (isLoggedIn) { | |
handleLogout(); | |
} else { | |
handleLogin(); | |
} | |
}}> | |
{isLoggingIn ? 'Cancel Log in' : (isLoggedIn ? 'Log out' : 'Log in')} | |
</button> | |
<div id="myLoginDiv"></div> | |
<Routes> | |
<Route path="/protected" element={ | |
<ProtectedRoute user={user}> | |
<ProtectedPage user={user}/> | |
</ProtectedRoute>} /> | |
<Route index element={ | |
<PublicPage /> | |
} /> | |
</Routes> | |
</div> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment