{"id":13810486,"url":"https://github.com/mikemajara/nextjs-prisma-next-auth-credentials","last_synced_at":"2025-05-14T10:33:43.558Z","repository":{"id":36964967,"uuid":"437080628","full_name":"mikemajara/nextjs-prisma-next-auth-credentials","owner":"mikemajara","description":"NextJS Application with Prisma \u0026 Nextauth ready to use","archived":false,"fork":false,"pushed_at":"2022-06-20T07:07:18.000Z","size":110,"stargazers_count":117,"open_issues_count":0,"forks_count":23,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-06-27T07:33:40.428Z","etag":null,"topics":["nextauth","nextjs","prisma"],"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/mikemajara.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}},"created_at":"2021-12-10T18:41:54.000Z","updated_at":"2024-06-07T20:35:16.000Z","dependencies_parsed_at":"2022-07-11T11:34:34.085Z","dependency_job_id":null,"html_url":"https://github.com/mikemajara/nextjs-prisma-next-auth-credentials","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemajara%2Fnextjs-prisma-next-auth-credentials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemajara%2Fnextjs-prisma-next-auth-credentials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemajara%2Fnextjs-prisma-next-auth-credentials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemajara%2Fnextjs-prisma-next-auth-credentials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikemajara","download_url":"https://codeload.github.com/mikemajara/nextjs-prisma-next-auth-credentials/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213870383,"owners_count":15650179,"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":["nextauth","nextjs","prisma"],"created_at":"2024-08-04T02:00:56.010Z","updated_at":"2024-08-04T02:01:54.537Z","avatar_url":"https://github.com/mikemajara.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# NextJS - Prisma - NextAuth - Credentials \u0026 OAuth\n\n## Introduction\n\nNextJS starter pack with\n- [Prisma](https://www.prisma.io/)\n- [Chakra-UI](https://chakra-ui.com/)\n- [NextAuthJS](https://next-auth.js.org/)\n  - [Email (passwordless)](https://next-auth.js.org/providers/email)\n  - [OAuth (Github)](https://next-auth.js.org/providers/github)\n  - [Credentials (Email \u0026 Password)](https://next-auth.js.org/providers/credentials)\n\nThis is a starter kit for authentication in NextJS. It is a fork from [rest-nextjs-api-routes-auth](https://github.com/prisma/prisma-examples/tree/latest/typescript/rest-nextjs-api-routes-auth), read more in the [installation instructions](installation.md)\n\nThis repo illustrates user authentication logic with NextAuth v4 combined with credentials using the default configuration and the Prisma Adapter. No [callbacks](https://next-auth.js.org/configuration/callbacks) are used or needed for the flow to work - you can use both combined.\n\n# Install \u0026 run\n\ninstall\n```\ngit clone https://github.com/mikemajara/nextjs-prisma-next-auth-credentials\nyarn install\n```\n\ncopy environment and fill in with your data\n```\ncp .env .env.local\n```\n\nrun\n```\nyarn dev\n```\n\n## Motiviation\nSetting up credentials is generally [not recommended](https://github.com/nextauthjs/next-auth/discussions/3364) \"_with your database because of the security implications most people aren't ware of._\", but they are widely used and much needed for applications, specially at the start of a project. You don't want to start dealing with OAuth from the start, but need some user management.\n\nNextauth has ~~very~~ **too** simple instructions and barely pays attention to credentials, so I decided to set up this project to experiment with the whole auth flow. **My key takeaways are**:\n- Default settings are enough to use both OAuth providers and your own credentials.\n- You should be able to authorize using any given API (this project uses NextJS API to check against the same prisma DB used with an [adapter](https://next-auth.js.org/adapters/overview))\n- Session JWT is needed (as opposed to database strategy)\n\n## Gotchas\n\n### Using Gmail as your email provider\n\nIf you are using Gmail to send e-mails for passwordless authentication, make sure you enable **Less secure app access**. Go to Google \u003e Manage Account \u003e Security \u003e Less secure app access, turn it on. If you don't, google will reject your user \u0026 password accessed by `nodemailer`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikemajara%2Fnextjs-prisma-next-auth-credentials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikemajara%2Fnextjs-prisma-next-auth-credentials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikemajara%2Fnextjs-prisma-next-auth-credentials/lists"}