├── components ├── footer.module.css ├── layout.js ├── access-denied.js ├── footer.js ├── header.module.css └── header.js ├── pages ├── api │ ├── examples │ │ ├── session.js │ │ ├── jwt.js │ │ └── protected.js │ └── auth │ │ └── [...nextauth].js ├── index.js ├── _app.js ├── api-example.js ├── styles.css ├── client.js ├── protected.js └── server.js ├── package.json ├── .gitignore └── yarn.lock /components/footer.module.css: -------------------------------------------------------------------------------- 1 | .footer { 2 | margin-top: 2rem; 3 | } 4 | 5 | .navItems { 6 | margin-bottom: 1rem; 7 | padding: 0; 8 | list-style: none; 9 | } 10 | 11 | .navItem { 12 | display: inline-block; 13 | margin-right: 1rem; 14 | } -------------------------------------------------------------------------------- /pages/api/examples/session.js: -------------------------------------------------------------------------------- 1 | // This is an example of how to access a session from an API route 2 | import { getSession } from 'next-auth/client' 3 | 4 | export default async (req, res) => { 5 | const session = await getSession({ req }) 6 | res.send(JSON.stringify(session, null, 2)) 7 | } -------------------------------------------------------------------------------- /components/layout.js: -------------------------------------------------------------------------------- 1 | import Header from '../components/header' 2 | import Footer from '../components/footer' 3 | 4 | export default function Layout ({children}) { 5 | return ( 6 | <> 7 |
8 |
9 | {children} 10 |
11 |