{"id":19684923,"url":"https://github.com/boolfalse/nextjs-auth","last_synced_at":"2026-06-03T23:31:24.059Z","repository":{"id":222913837,"uuid":"756090485","full_name":"boolfalse/nextjs-auth","owner":"boolfalse","description":"Next.js authentication boilerplate","archived":false,"fork":false,"pushed_at":"2024-02-16T22:23:41.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-10T06:58:52.781Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boolfalse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-11T23:16:25.000Z","updated_at":"2024-02-16T22:25:37.000Z","dependencies_parsed_at":"2024-02-17T00:27:09.138Z","dependency_job_id":"ad2eba3a-2a2e-4d2b-ae7d-cf0dca5ccaef","html_url":"https://github.com/boolfalse/nextjs-auth","commit_stats":null,"previous_names":["boolfalse/nextjs-auth"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolfalse%2Fnextjs-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolfalse%2Fnextjs-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolfalse%2Fnextjs-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boolfalse%2Fnextjs-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boolfalse","download_url":"https://codeload.github.com/boolfalse/nextjs-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240993432,"owners_count":19890418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-11T18:19:20.996Z","updated_at":"2026-06-03T23:31:24.031Z","avatar_url":"https://github.com/boolfalse.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## Next.js Authentication Boilerplate\n\n\n### Installation\n\n- Install dependencies:\n\n```bash\nnpm i\n```\n\n- Create a MongoDB cluster and get the connection string from the [MongoDB dashboard](https://cloud.mongodb.com/).\n\n- Create a `.env` file in the root directory as per the `.env.example` file:\n\n```shell\ncp .env.example .env\n```\n\n- Set MongoDB credentials in the `.env` file:\n\n```dotenv\nMONGODB_USER=\"user\"\nMONGODB_PASSWORD=\"password\"\nMONGODB_DATABASE=\"database\"\nMONGODB_CLUSTER=\"cluster0\"\nMONGODB_DOMAIN=\"mzcsh.mongodb.net\"\n```\n\n- Generate a secret key:\n\n```shell\nopenssl rand -base64 32\n```\n\n- Set `AUTH_SECRET` and `NEXTAUTH_URL` in the `.env` file:\n\n```dotenv\nNEXTAUTH_SECRET=\"\u003cgenerated_key\u003e\"\nNEXTAUTH_URL=\"http://localhost:3000\"\n```\n\n- Set the `ADMIN_EMAIL` in the `.env` file (GitHub email used in this example):\n\n```dotenv\nADMIN_EMAIL=\"admin@gmail.com\"\n```\n\n- Create a [GitHub OAuth app](https://github.com/settings/developers) and set the `GITHUB_ID` and `GITHUB_SECRET` in the `.env` file:\n\n```dotenv\nGITHUB_ID=\"\u003cgithub_id\u003e\"\nGITHUB_SECRET=\"\u003cgithub_secret\u003e\"\n```\n\n- Run the server:\n\n```bash\nnpm run dev\n# or\nnpm start\n```\n\n- Open [http://localhost:3000](http://localhost:3000) on your browser.\n\n\n### Resources\n\n- [Next.js Authentication - AuthJS / NextAuth for Role-Based Security](https://www.youtube.com/watch?v=MNm1XhDjX1s)\n- [ClarityCoders/NextAuthTutorial-Video](https://github.com/ClarityCoders/NextAuthTutorial-Video)\n\n- [Next.js 14 Admin Dashboard Tutorial | Fullstack Next.js 14 Project with Server Actions](https://www.youtube.com/watch?v=cBg6xA5C60s)\n- [safak/nextadmin](https://github.com/safak/nextadmin/tree/completed)\n\n- [Credentials authentication](https://authjs.dev/getting-started/providers/credentials-tutorial)\n- [Protecting your routes with Next.js Middleware](https://nextjs.org/learn/dashboard-app/adding-authentication#protecting-your-routes-with-nextjs-middleware)\n- [Authentication](https://nextjs.org/docs/pages/building-your-application/authentication)\n\n- [Error: NEXT_REDIRECT while using server actions #49298](https://github.com/vercel/next.js/issues/49298#issuecomment-1542055642)\n- [User object is empty #2762](https://github.com/nextauthjs/next-auth/discussions/2762)\n\n\n### Author\n\n- [BoolFalse](https://boolfalse.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboolfalse%2Fnextjs-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboolfalse%2Fnextjs-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboolfalse%2Fnextjs-auth/lists"}