import { useUser } from "../lib/hooks"; import Layout from "../components/layout"; const Home = () => { const user = useUser(); return (

Magic Example

Steps to test this authentication example:

  1. Click Login and enter an email.
  2. You'll be redirected to Home. Click on Profile, notice how your session is being used through a token stored in a cookie.
  3. Click Logout and try to go to Profile again. You'll get redirected to Login.

To learn more about Magic, visit their{" "} documentation .

{user && ( <>

Currently logged in as:

{JSON.stringify(user, null, 2)}
)}
); }; export default Home;