rsnext/examples/with-passport/pages/profile.js
Luis Alvarez D b540054388
Update authentication examples (#19330)
* Updated example readme

* Updated with-passport example

* Updated profile page for with-passport

* Updated with-passport-and-next-connect

* Updated with-magic

* Updated with-magic readme

* Updated with-iron-session

* Updated next version in with-iron-session

Co-authored-by: Lee Robinson <me@leerob.io>
2020-12-29 12:43:47 -05:00

27 lines
508 B
JavaScript

import { useUser } from '../lib/hooks'
import Layout from '../components/layout'
const Profile = () => {
const user = useUser({ redirectTo: '/login' })
return (
<Layout>
<h1>Profile</h1>
{user && (
<>
<p>Your session:</p>
<pre>{JSON.stringify(user, null, 2)}</pre>
</>
)}
<style jsx>{`
pre {
white-space: pre-wrap;
word-wrap: break-word;
}
`}</style>
</Layout>
)
}
export default Profile