├── .clj-kondo └── .cache │ └── v1 │ └── lock ├── .npmrc ├── app ├── favicon.ico ├── api │ └── protected │ │ └── route.ts ├── auth │ └── [...nextauth] │ │ └── route.ts ├── middleware-example │ └── page.tsx ├── client-example │ └── page.tsx ├── server-example │ └── page.tsx ├── layout.tsx ├── globals.css ├── [...proxy] │ └── route.tsx ├── api-example │ └── page.tsx ├── policy │ └── page.tsx ├── page.tsx └── ReportForm.jsx ├── public └── logo.png ├── next.config.js ├── postcss.config.js ├── lib └── utils.ts ├── .github └── FUNDING.yml ├── components ├── footer.module.css ├── layout.tsx ├── header.tsx ├── access-denied.tsx ├── auth-components.tsx ├── ui │ ├── input.tsx │ ├── avatar.tsx │ ├── button.tsx │ ├── navigation-menu.tsx │ └── dropdown-menu.tsx ├── custom-link.tsx ├── footer.tsx ├── session-data.tsx ├── header.module.css ├── user-button.tsx ├── main-nav.tsx └── client-example.tsx ├── .gitignore ├── components.json ├── .lsp └── .cache │ └── db.transit.json ├── docker-compose.yml ├── middleware.ts ├── .env.local.example ├── LICENSE ├── test-docker.sh ├── tsconfig.json ├── contentful.js ├── package.json ├── Dockerfile ├── tailwind.config.js ├── auth.ts └── README.md /.clj-kondo/.cache/v1/lock: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | ignore-scripts=true 2 | -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/auth-next-example/main/app/favicon.ico -------------------------------------------------------------------------------- /public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/contentful/auth-next-example/main/public/logo.png -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import("next").NextConfig} */ 2 | module.exports = { 3 | output: "standalone", 4 | } 5 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { type ClassValue, clsx } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository 2 | 3 | open_collective: nextauth 4 | github: [balazsorban44, ThangHuuVu] 5 | -------------------------------------------------------------------------------- /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 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | node_modules/ 4 | logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | lerna-debug.log* 10 | .yarn-integrity 11 | .npm 12 | 13 | .eslintcache 14 | 15 | *.tsbuildinfo 16 | next-env.d.ts 17 | 18 | .next 19 | .vercel 20 | .env*.local -------------------------------------------------------------------------------- /app/api/protected/route.ts: -------------------------------------------------------------------------------- 1 | import { auth } from "auth" 2 | 3 | export const GET = auth((req) => { 4 | if (req.auth) { 5 | return Response.json({ data: "Protected data" }) 6 | } 7 | 8 | return Response.json({ message: "Not authenticated" }, { status: 401 }) 9 | }) as any // TODO: Fix `auth()` return type 10 | -------------------------------------------------------------------------------- /components/layout.tsx: -------------------------------------------------------------------------------- 1 | import Header from "./header" 2 | import Footer from "./footer" 3 | import type { ReactNode } from "react" 4 | 5 | export default function Layout({ children }: { children: ReactNode }) { 6 | return ( 7 | <> 8 |
9 |
{children}
10 |