Skip to content

Instantly share code, notes, and snippets.

@Joshscorp
Last active July 14, 2022 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Joshscorp/7421131f341b4591488fc29363419b87 to your computer and use it in GitHub Desktop.
Save Joshscorp/7421131f341b4591488fc29363419b87 to your computer and use it in GitHub Desktop.
OnzAuth App.js initialisation
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