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