{"id":23439700,"url":"https://github.com/sanidhyy/next-auth","last_synced_at":"2026-03-12T07:01:32.323Z","repository":{"id":215238464,"uuid":"737793483","full_name":"sanidhyy/next-auth","owner":"sanidhyy","description":"Next - A simple authentication service.","archived":false,"fork":false,"pushed_at":"2026-02-17T17:23:23.000Z","size":2103,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-17T22:30:04.491Z","etag":null,"topics":["authentication","authjs","css","html","js","login","modern-ui","next","next-auth","nextjs","react","reactjs","register","server-actions","shadcn-ui","typescript"],"latest_commit_sha":null,"homepage":"https://nextoauth.netlify.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sanidhyy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["sanidhyy"],"patreon":"sanidhy","custom":"https://www.buymeacoffee.com/sanidhy"}},"created_at":"2024-01-01T14:22:54.000Z","updated_at":"2026-02-17T17:23:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"777b9f8a-a5d2-4d14-8fdf-f0936906443c","html_url":"https://github.com/sanidhyy/next-auth","commit_stats":null,"previous_names":["sanidhyy/next-auth"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sanidhyy/next-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanidhyy%2Fnext-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanidhyy%2Fnext-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanidhyy%2Fnext-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanidhyy%2Fnext-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanidhyy","download_url":"https://codeload.github.com/sanidhyy/next-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanidhyy%2Fnext-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30417685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T06:40:58.731Z","status":"ssl_error","status_checked_at":"2026-03-12T06:40:40.296Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","authjs","css","html","js","login","modern-ui","next","next-auth","nextjs","react","reactjs","register","server-actions","shadcn-ui","typescript"],"created_at":"2024-12-23T15:33:27.139Z","updated_at":"2026-03-12T07:01:32.316Z","avatar_url":"https://github.com/sanidhyy.png","language":"TypeScript","funding_links":["https://github.com/sponsors/sanidhyy","https://patreon.com/sanidhy","https://www.buymeacoffee.com/sanidhy"],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n# Next - A simple authentication service\n\n![Next - A simple authentication service](/.github/images/img_main.png \"Next - A simple authentication service\")\n\n[![Ask Me Anything!](https://flat.badgen.net/static/Ask%20me/anything?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy \"Ask Me Anything!\")\n[![GitHub license](https://flat.badgen.net/github/license/sanidhyy/next-auth?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/next-auth/blob/main/LICENSE \"GitHub license\")\n[![Maintenance](https://flat.badgen.net/static/Maintained/yes?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/next-auth/commits/main \"Maintenance\")\n[![GitHub branches](https://flat.badgen.net/github/branches/sanidhyy/next-auth?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/next-auth/branches \"GitHub branches\")\n[![Github commits](https://flat.badgen.net/github/commits/sanidhyy/next-auth?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/next-auth/commits \"Github commits\")\n[![Netlify Status](https://api.netlify.com/api/v1/badges/8f6a1f3f-82b3-4898-b3f3-87030da18b16/deploy-status)](https://nextoauth.netlify.app \"Netlify Status\")\n[![GitHub issues](https://flat.badgen.net/github/issues/sanidhyy/next-auth?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/next-auth/issues \"GitHub issues\")\n[![GitHub pull requests](https://flat.badgen.net/github/prs/sanidhyy/next-auth?icon=github\u0026color=black\u0026scale=1.01)](https://github.com/sanidhyy/next-auth/pulls \"GitHub pull requests\")\n\n\u003c!-- Table of Contents --\u003e\n\u003cdetails\u003e\n\n\u003csummary\u003e\n\n# :notebook_with_decorative_cover: Table of Contents\n\n\u003c/summary\u003e\n\n- [Folder Structure](#bangbang-folder-structure)\n- [Getting Started](#toolbox-getting-started)\n- [Screenshots](#camera-screenshots)\n- [Tech Stack](#gear-tech-stack)\n- [Stats](#wrench-stats)\n- [Contribute](#raised_hands-contribute)\n- [Acknowledgements](#gem-acknowledgements)\n- [Buy Me a Coffee](#coffee-buy-me-a-coffee)\n- [Follow Me](#rocket-follow-me)\n- [Learn More](#books-learn-more)\n- [Deploy on Vercel](#page_with_curl-deploy-on-vercel)\n- [Give A Star](#star-give-a-star)\n- [Star History](#star2-star-history)\n- [Give A Star](#star-give-a-star)\n\n\u003c/details\u003e\n\n## :bangbang: Folder Structure\n\nHere is the folder structure of this app.\n\n\u003c!--- FOLDER_STRUCTURE_START ---\u003e\n```bash\nnext-auth/\n  |- actions/\n    |-- admin.ts\n    |-- login.ts\n    |-- logout.ts\n    |-- new-password.ts\n    |-- new-verification.ts\n    |-- register.ts\n    |-- reset.ts\n    |-- settings.ts\n  |- app/\n    |-- (protected)/\n    |-- api/\n    |-- auth/\n    |-- apple-icon.png\n    |-- favicon.ico\n    |-- globals.css\n    |-- icon1.png\n    |-- icon2.png\n    |-- layout.tsx\n    |-- page.tsx\n  |- components/\n    |-- auth/\n    |-- ui/\n    |-- form-error.tsx\n    |-- form-success.tsx\n    |-- user-info.tsx\n  |- config/\n    |-- site.ts\n  |- data/\n    |-- account.ts\n    |-- password-reset-token.ts\n    |-- two-factor-confirmation.ts\n    |-- two-factor-token.ts\n    |-- user.ts\n    |-- verification-token.ts\n  |- hooks/\n    |-- use-current-role.ts\n    |-- use-current-user.ts\n  |- lib/\n    |-- auth.ts\n    |-- db.ts\n    |-- mail.ts\n    |-- tokens.ts\n    |-- utils.ts\n  |- prisma/\n    |-- schema.prisma\n  |- schemas/\n    |-- index.ts\n  |- .env.example\n  |- .env/.env.local\n  |- .eslintrc.json\n  |- .gitignore\n  |- auth.config.ts\n  |- auth.ts\n  |- bun.lock\n  |- components.json\n  |- middleware.ts\n  |- netlify.toml\n  |- next-auth.d.ts\n  |- next.config.js\n  |- package.json\n  |- postcss.config.js\n  |- routes.ts\n  |- tailwind.config.ts\n  |- tsconfig.json\n```\n\u003c!--- FOLDER_STRUCTURE_END ---\u003e\n\n\u003cbr /\u003e\n\n## :toolbox: Getting Started\n\n1. Make sure **Git** and **NodeJS** is installed.\n2. Clone this repository to your local computer.\n3. Create `.env` file in root directory.\n4. Contents of `.env`:\n\n```bash\n# .env\n\n# neon postgresql db\nDATABASE_URL=\"postgresql://\u003cusername\u003e:\u003cpassword\u003e@\u003chost\u003e:\u003cport\u003e/next-auth?sslmode=require\u0026pgbouncer=true\"\nDIRECT_URL=\"postgresql://\u003cusername\u003e:\u003cpassword\u003e@\u003chost\u003e:\u003cport\u003e/next-auth?sslmode=require\"\n\n# random auth secret (https://generate-secret.vercel.app/32)\nAUTH_SECRET=\"xxxxxxxxxxxxxxxxxxxxxxxxxx\"\n\n# next auth base url\nNEXTAUTH_URL=http://localhost:3000\n\n# github auth keys\nGITHUB_CLIENT_ID=xxxxxxxxxxxxxx\nGITHUB_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\n# google auth keys\nGOOGLE_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com\nGOOGLE_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n\n# resend api key\nRESEND_API_KEY=re_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX\nRESEND_API_EMAIL=\"onboarding@resend.dev\"\n```\n\n5. Set up a Neon PostgreSQL Database\n\n1. **Obtain PostgreSQL Database URL:**\n   - If you don't have a Neon PostgreSQL database, create one.\n   - Obtain the database URL, which typically looks like `postgresql://\u003cusername\u003e:\u003cpassword\u003e@\u003chost\u003e:\u003cport\u003e/\u003cdatabase-name\u003e`.\n\n1. **Update `.env` with Database Configuration:**\n   - Open your `.env` file.\n   - Update the following variables with your Neon PostgreSQL database information:\n\n     ```bash\n     # .env\n\n     # Neon PostgreSQL db\n     DATABASE_URL=\"postgresql://\u003cyour-neondb-username\u003e:\u003cyour-neondb-password\u003e@\u003cyour-neondb-host\u003e:\u003cyour-neondb-port\u003e/next-auth?sslmode=require\u0026pgbouncer=true\"\n     DIRECT_URL=\"postgresql://\u003cyour-neondb-username\u003e:\u003cyour-neondb-password\u003e@\u003cyour-neondb-host\u003e:\u003cyour-neondb-port\u003e/next-auth?sslmode=require\"\n     ```\n\n1. Generate Authentication Secret\n\n1. **Generate Random Authentication Secret:**\n   - Visit [generate-secret.vercel.app](https://generate-secret.vercel.app/32).\n   - Copy the generated secret.\n\n1. **Update `.env` with Authentication Secret:**\n   - Open your `.env` file.\n   - Update the `AUTH_SECRET` variable with the generated secret:\n\n     ```bash\n     # .env\n\n     # Random auth secret\n     AUTH_SECRET=\"xxxxxxxxxxxxxxxxxxxxxxxxxx\"\n     ```\n\n1. Configure NextAuth Base URL\n\n1. **Set NextAuth Base URL:**\n   - Open your `.env` file.\n   - Set the `NEXTAUTH_URL` variable to the base URL of your Next.js application:\n\n     ```bash\n     # .env\n\n     # NextAuth base URL\n     NEXTAUTH_URL=http://localhost:3000\n     ```\n\n1. Obtain GitHub Authentication Keys\n\n1. **Register Application on GitHub:**\n   - Go to the [GitHub Developer Settings](https://github.com/settings/developers) and register a new OAuth application.\n   - Obtain the client ID and client secret.\n\n1. **Update `.env` with GitHub Keys:**\n   - Open your `.env` file.\n   - Update the following variables with the obtained GitHub keys:\n\n     ```bash\n     # .env\n\n     # GitHub auth keys\n     GITHUB_CLIENT_ID=xxxxxxxxxxxxxx\n     GITHUB_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n     ```\n\n1. Obtain Google Authentication Keys\n\n1. **Register Application on Google Cloud Console:**\n   - Go to the [Google Cloud Console](https://console.cloud.google.com/) and create a new project.\n   - Enable the \"Google+ API\" for your project and create credentials to obtain the client ID and client secret.\n\n1. **Update `.env` with Google Keys:**\n   - Open your `.env` file.\n   - Update the following variables with the obtained Google keys:\n\n     ```bash\n     # .env\n\n     # Google auth keys\n     GOOGLE_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com\n     GOOGLE_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n     ```\n\n1. Set Up Resend API Key\n\n1. **Obtain Resend API Key and Email:**\n   - Obtain an API key and email from Resend for onboarding purposes.\n\n1. **Update `.env` with Resend API Key and Email:**\n   - Open your `.env` file.\n   - Update the following variables with the obtained Resend API key and email:\n\n     ```bash\n     # .env\n\n     # Resend API key and email\n     RESEND_API_KEY=re_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n     RESEND_API_EMAIL=\"onboarding@resend.dev\"\n     ```\n\n1. Open terminal in root directory. Run `npm install --legacy-peer-deps` or `yarn install --legacy-peer-deps`.\n\n1. Now app is fully configured 👍 and you can start using this app using `npm run dev` or `yarn dev`.\n\n**NOTE:** Please make sure to keep your API keys and configuration values secure and do not expose them publicly.\n\n## :camera: Screenshots:\n\n![Modern UI/UX](/.github/images/img1.png \"Modern UI/UX\")\n\n![Server Components](/.github/images/img2.png \"Server Components\")\n\n![Client Components](/.github/images/img3.png \"Client Components\")\n\n## :gear: Tech Stack\n\n[![React JS](https://skillicons.dev/icons?i=react \"React JS\")](https://react.dev/ \"React JS\") [![Next JS](https://skillicons.dev/icons?i=next \"Next JS\")](https://nextjs.org/ \"Next JS\") [![Typescript](https://skillicons.dev/icons?i=ts \"Typescript\")](https://www.typescriptlang.org/ \"Typescript\") [![Tailwind CSS](https://skillicons.dev/icons?i=tailwind \"Tailwind CSS\")](https://tailwindcss.com/ \"Tailwind CSS\") [![Vercel](https://skillicons.dev/icons?i=vercel \"Vercel\")](https://vercel.app/ \"Vercel\") [![Prisma](https://skillicons.dev/icons?i=prisma \"Prisma\")](https://prisma.io/ \"Prisma\")\n\n## :wrench: Stats\n\n[![Stats for Next](/.github/images/stats.svg \"Stats for Next\")](https://pagespeed.web.dev/analysis?url=https://nextoauth.netlify.app/ \"Stats for Next\")\n\n## :raised_hands: Contribute\n\nYou might encounter some bugs while using this app. You are more than welcome to contribute. Just submit changes via pull request and I will review them before merging. Make sure you follow community guidelines.\n\n## :gem: Acknowledgements\n\nUseful resources and dependencies that are used in Next.\n\n- Thanks to CodeWithAntonio: https://codewithantonio.com/\n\u003c!--- DEPENDENCIES_START ---\u003e\n- [@auth/prisma-adapter](https://www.npmjs.com/package/@auth/prisma-adapter): ^1.0.12\n- [@hookform/resolvers](https://www.npmjs.com/package/@hookform/resolvers): ^3.10.0\n- [@prisma/client](https://www.npmjs.com/package/@prisma/client): ^5.7.1\n- [@radix-ui/react-avatar](https://www.npmjs.com/package/@radix-ui/react-avatar): ^1.1.11\n- [@radix-ui/react-dialog](https://www.npmjs.com/package/@radix-ui/react-dialog): ^1.1.15\n- [@radix-ui/react-dropdown-menu](https://www.npmjs.com/package/@radix-ui/react-dropdown-menu): ^2.1.16\n- [@radix-ui/react-icons](https://www.npmjs.com/package/@radix-ui/react-icons): ^1.3.2\n- [@radix-ui/react-label](https://www.npmjs.com/package/@radix-ui/react-label): ^2.1.8\n- [@radix-ui/react-select](https://www.npmjs.com/package/@radix-ui/react-select): ^2.2.6\n- [@radix-ui/react-slot](https://www.npmjs.com/package/@radix-ui/react-slot): ^1.2.4\n- [@radix-ui/react-switch](https://www.npmjs.com/package/@radix-ui/react-switch): ^1.2.6\n- [@types/bcrypt](https://www.npmjs.com/package/@types/bcrypt): ^6.0.0\n- [@types/bcryptjs](https://www.npmjs.com/package/@types/bcryptjs): ^3.0.0\n- [@types/node](https://www.npmjs.com/package/@types/node): ^25.2.3\n- [@types/react](https://www.npmjs.com/package/@types/react): ^19.2.14\n- [@types/react-dom](https://www.npmjs.com/package/@types/react-dom): ^19.2.3\n- [@types/uuid](https://www.npmjs.com/package/@types/uuid): ^11.0.0\n- [autoprefixer](https://www.npmjs.com/package/autoprefixer): ^10.4.24\n- [bcrypt](https://www.npmjs.com/package/bcrypt): ^6.0.0\n- [bcryptjs](https://www.npmjs.com/package/bcryptjs): ^3.0.3\n- [class-variance-authority](https://www.npmjs.com/package/class-variance-authority): ^0.7.1\n- [clsx](https://www.npmjs.com/package/clsx): ^2.1.1\n- [eslint](https://www.npmjs.com/package/eslint): ^8\n- [eslint-config-next](https://www.npmjs.com/package/eslint-config-next): 14.0.4\n- [next](https://www.npmjs.com/package/next): 15.5.10\n- [next-auth](https://www.npmjs.com/package/next-auth): ^5.0.0-beta.4\n- [next-themes](https://www.npmjs.com/package/next-themes): ^0.4.6\n- [postcss](https://www.npmjs.com/package/postcss): ^8\n- [prisma](https://www.npmjs.com/package/prisma): ^5.7.1\n- [react](https://www.npmjs.com/package/react): ^19.2.4\n- [react-dom](https://www.npmjs.com/package/react-dom): ^19.2.4\n- [react-hook-form](https://www.npmjs.com/package/react-hook-form): ^7.71.1\n- [react-icons](https://www.npmjs.com/package/react-icons): ^5.5.0\n- [react-spinners](https://www.npmjs.com/package/react-spinners): ^0.17.0\n- [resend](https://www.npmjs.com/package/resend): ^6.9.2\n- [sonner](https://www.npmjs.com/package/sonner): ^1.7.4\n- [tailwind-merge](https://www.npmjs.com/package/tailwind-merge): ^2.2.0\n- [tailwindcss](https://www.npmjs.com/package/tailwindcss): ^3.3.0\n- [tailwindcss-animate](https://www.npmjs.com/package/tailwindcss-animate): ^1.0.7\n- [typescript](https://www.npmjs.com/package/typescript): ^5.9.3\n- [uuid](https://www.npmjs.com/package/uuid): ^13.0.0\n- [zod](https://www.npmjs.com/package/zod): ^4.3.6\n\n\u003c!--- DEPENDENCIES_END ---\u003e\n\n## :coffee: Buy Me a Coffee\n\n[\u003cimg src=\"https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge\u0026logo=buy-me-a-coffee\u0026logoColor=black\" width=\"200\" /\u003e](https://www.buymeacoffee.com/sanidhy \"Buy me a Coffee\")\n\n## :rocket: Follow Me\n\n[![GitHub followers](https://img.shields.io/github/followers/sanidhyy?style=social\u0026label=Follow\u0026maxAge=2592000)](https://github.com/sanidhyy \"Follow Me\")\n[![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fx.com%2F_sanidhyy)](https://x.com/intent/tweet?text=Wow:\u0026url=https%3A%2F%2Fgithub.com%2Fsanidhyy%2Fnext-auth \"Tweet\")\n\n## :books: Learn More\n\nTo learn more about Next.js, take a look at the following resources:\n\n- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.\n- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.\n\nYou can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!\n\n## :page_with_curl: Deploy on Vercel\n\nThe easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template\u0026filter=next.js\u0026utm_source=create-next-app\u0026utm_campaign=create-next-app-readme) from the creators of Next.js.\n\nCheck out [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.\n\n## :star: Give A Star\n\nYou can also give this repository a star to show more people and they can use this repository.\n\n## :star2: Star History\n\n\u003ca href=\"https://star-history.com/#sanidhyy/next-auth\u0026Timeline\"\u003e\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=sanidhyy/next-auth\u0026type=Timeline\u0026theme=dark\" /\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=sanidhyy/next-auth\u0026type=Timeline\" /\u003e\n  \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=sanidhyy/next-auth\u0026type=Timeline\" /\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\n\u003cbr /\u003e\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanidhyy%2Fnext-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanidhyy%2Fnext-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanidhyy%2Fnext-auth/lists"}