{"id":16969111,"url":"https://github.com/shadmanshakib/next-auth-v5","last_synced_at":"2025-03-21T18:43:18.616Z","repository":{"id":243776974,"uuid":"762757254","full_name":"ShadmanShakib/next-auth-v5","owner":"ShadmanShakib","description":"Next-Auth version 5, with Postgres and Prisma","archived":false,"fork":false,"pushed_at":"2024-06-11T03:41:42.000Z","size":195,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T13:30:30.618Z","etag":null,"topics":["authentication","next-auth","nextjs","postgresql","prisma","react","saas","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ShadmanShakib.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,"publiccode":null,"codemeta":null}},"created_at":"2024-02-24T15:56:58.000Z","updated_at":"2024-09-26T12:04:12.000Z","dependencies_parsed_at":"2024-06-11T04:57:49.591Z","dependency_job_id":null,"html_url":"https://github.com/ShadmanShakib/next-auth-v5","commit_stats":null,"previous_names":["shadmanshakib/next-auth-v5"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShadmanShakib%2Fnext-auth-v5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShadmanShakib%2Fnext-auth-v5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShadmanShakib%2Fnext-auth-v5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShadmanShakib%2Fnext-auth-v5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShadmanShakib","download_url":"https://codeload.github.com/ShadmanShakib/next-auth-v5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244852132,"owners_count":20521151,"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":["authentication","next-auth","nextjs","postgresql","prisma","react","saas","zod"],"created_at":"2024-10-14T00:24:03.797Z","updated_at":"2025-03-21T18:43:18.595Z","avatar_url":"https://github.com/ShadmanShakib.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next Auth v5 - Advanced Guide (2024)\n\n![image](https://github.com/AntonioErdeljac/next-auth-v5-advanced-guide/assets/23248726/d0175397-8c3f-4e82-91c4-78c14f29bb81)\n\nThis is a repository for Next Auth v5 - Advanced Guide (2024)\n\n[VIDEO TUTORIAL](https://youtu.be/1MTyCvS05V4)\n\nKey Features:\n- 🔐 Next-auth v5 (Auth.js)\n- 🚀 Next.js 14 with server actions\n- 🔑 Credentials Provider\n- 🌐 OAuth Provider (Social login with Google \u0026 GitHub)\n- 🔒 Forgot password functionality\n- ✉️ Email verification\n- 📱 Two factor verification\n- 👥 User roles (Admin \u0026 User)\n- 🔓 Login component (Opens in redirect or modal)\n- 📝 Register component\n- 🤔 Forgot password component\n- ✅ Verification component\n- ⚠️ Error component\n- 🔘 Login button\n- 🚪 Logout button\n- 🚧 Role Gate\n- 🔍 Exploring next.js middleware\n- 📈 Extending \u0026 Exploring next-auth session\n- 🔄 Exploring next-auth callbacks\n- 👤 useCurrentUser hook\n- 🛂 useRole hook\n- 🧑 currentUser utility\n- 👮 currentRole utility\n- 🖥️ Example with server component\n- 💻 Example with client component\n- 👑 Render content for admins using RoleGate component\n- 🛡️ Protect API Routes for admins only\n- 🔐 Protect Server Actions for admins only\n- 📧 Change email with new verification in Settings page\n- 🔑 Change password with old password confirmation in Settings page\n- 🔔 Enable/disable two-factor auth in Settings page\n- 🔄 Change user role in Settings page (for development purposes only)\n\n### Prerequisites\n\n**Node version 18.7.x**\n\n### Cloning the repository\n\n```shell\ngit clone https://github.com/AntonioErdeljac/next-auth-v5-advanced-guide.git\n```\n\n### Install packages\n\n```shell\nnpm i\n```\n\n### Setup .env file\n\n\n```js\nDATABASE_URL=\nDIRECT_URL=\n\nAUTH_SECRET=\n\nGITHUB_CLIENT_ID=\nGITHUB_CLIENT_SECRET=\n\nGOOGLE_CLIENT_ID=\nGOOGLE_CLIENT_SECRET=\n\nRESEND_API_KEY=\n\nNEXT_PUBLIC_APP_URL=\n```\n\n### Setup Prisma\n```shell\nnpx prisma generate\nnpx prisma db push\n```\n\n### Start the app\n\n```shell\nnpm run dev\n```\n\n## Available commands\n\nRunning commands with npm `npm run [command]`\n\n| command         | description                              |\n| :-------------- | :--------------------------------------- |\n| `dev`           | Starts a development instance of the app |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadmanshakib%2Fnext-auth-v5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadmanshakib%2Fnext-auth-v5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadmanshakib%2Fnext-auth-v5/lists"}