Last active
July 14, 2022 05:58
-
-
Save Joshscorp/7421131f341b4591488fc29363419b87 to your computer and use it in GitHub Desktop.
OnzAuth App.js initialisation
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
const [ user, setUser ] = useState(null); | |
const [ isLoggingIn, setIsLoggingIn ] = useState(false); | |
const [ isLoggedIn, setIsLoggedIn ] = useState(auth.isAuthenticated()); | |
const navigate = useNavigate(); | |
const handleLogin = () => { | |
setIsLoggingIn(true); | |
auth.showLogin(); | |
}; | |
const handleLogout = () => auth.logout(); | |
const handleCancelLogin = () => auth.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment