├── .eslintrc.json ├── app ├── favicon.ico ├── page.tsx ├── api │ └── auth │ │ ├── [...nextauth] │ │ └── route.ts │ │ └── verify-email │ │ └── route.ts ├── (auth) │ ├── register │ │ └── page.tsx │ ├── layout.tsx │ └── login │ │ └── page.tsx ├── (protected) │ ├── dashboard │ │ └── page.tsx │ └── admin │ │ └── page.tsx ├── layout.tsx └── globals.css ├── next.config.mjs ├── postcss.config.mjs ├── lib ├── utils.ts ├── db.ts ├── mail.ts └── zod.ts ├── components.json ├── components ├── logout-button.tsx ├── button-social.tsx ├── ui │ ├── label.tsx │ ├── input.tsx │ ├── button.tsx │ └── form.tsx ├── form-register.tsx └── form-login.tsx ├── .env copy ├── types └── next-auth.d.ts ├── .gitignore ├── public ├── vercel.svg └── next.svg ├── tsconfig.json ├── package.json ├── prisma └── schema.prisma ├── auth.ts ├── README.md ├── middleware.ts ├── tailwind.config.ts ├── actions └── auth-action.ts └── auth.config.ts /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bluuweb/example-next-auth-v5/HEAD/app/favicon.ico -------------------------------------------------------------------------------- /app/page.tsx: -------------------------------------------------------------------------------- 1 | const HomePage = () => { 2 | return
{JSON.stringify(session, null, 2)}
14 | {JSON.stringify(session, null, 2)}
16 | Click the link below to verify your email
13 | Verify email 14 | `, 15 | }); 16 | 17 | return { 18 | success: true, 19 | }; 20 | } catch (error) { 21 | console.log(error); 22 | return { 23 | error: true, 24 | }; 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /components/ui/label.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import * as LabelPrimitive from "@radix-ui/react-label" 5 | import { cva, type VariantProps } from "class-variance-authority" 6 | 7 | import { cn } from "@/lib/utils" 8 | 9 | const labelVariants = cva( 10 | "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" 11 | ) 12 | 13 | const Label = React.forwardRef< 14 | React.ElementRef60 | Email verified, you can now login 61 |
62 | )} 63 | {OAuthAccountNotLinked && ( 64 |65 | To confirm your identity, sign in with the same account you used 66 | originally. 67 |
68 | )} 69 | 116 | 117 |161 | {body} 162 |
163 | ) 164 | }) 165 | FormMessage.displayName = "FormMessage" 166 | 167 | export { 168 | useFormField, 169 | Form, 170 | FormItem, 171 | FormLabel, 172 | FormControl, 173 | FormDescription, 174 | FormMessage, 175 | FormField, 176 | } 177 | --------------------------------------------------------------------------------