Created
February 19, 2022 09:45
-
-
Save igorasilveira/ca94da67dd13555b9cac3fd716904d6f to your computer and use it in GitHub Desktop.
profile.js
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
import { useUser, withPageAuthRequired } from "@auth0/nextjs-auth0"; | |
import Head from "next/head"; | |
import Navbar from "../components/Navbar"; | |
import styles from "../styles/Home.module.css"; | |
function Profile({ user, error, isLoading }) { | |
if (isLoading) return <div>Loading...</div>; | |
if (error) return <div>{error.message}</div>; | |
return ( | |
<div className={styles.container}> | |
<Head> | |
<title>Profile</title> | |
<meta name="description" content="Generated by create next app" /> | |
<link rel="icon" href="/favicon.ico" /> | |
</Head> | |
<Navbar /> | |
<main className={styles.main}> | |
<h1 className={styles.title}>Welcome to your profile.</h1> | |
<p className={styles.description}>Here are your details:</p> | |
<p>{JSON.stringify(user)}</p> | |
</main> | |
</div> | |
); | |
} | |
export default withPageAuthRequired(Profile); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment