mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-09 18:26:40 +00:00
18 lines
423 B
TypeScript
18 lines
423 B
TypeScript
import React from "react";
|
|
import { useAuth0 } from "../authentication/auth0";
|
|
|
|
const NavBar = () => {
|
|
const { isAuthenticated, loginWithRedirect, logout } = useAuth0();
|
|
|
|
return (
|
|
<div>
|
|
{!isAuthenticated && (
|
|
<button onClick={() => loginWithRedirect({})}>Log in</button>
|
|
)}
|
|
|
|
{isAuthenticated && <button onClick={() => logout()}>Log out</button>}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default NavBar;
|