Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(adapter): remove adapters from core #1919

Merged
merged 12 commits into from
Jun 9, 2021
Merged

Conversation

balazsorban44
Copy link
Member

@balazsorban44 balazsorban44 commented May 3, 2021

Reasoning 💡

After having tried a lot of options to make typeorm optional in the core, the best solution seems to be ... to remove it all together!

All our adapters have their own packages now, and their development can be followed here: https://github.com/nextauthjs/adapters

Checklist 🧢

Feel free cross items ( like this ~[] item~ ) if they're irrelevant to your changes.

To check an item, place an x in the box like so: - [x] Documentation.

  • Documentation (Remove ALL database references, provide a migration to adapter)
  • Tests
  • Ready to be merged

Affected issues 🎟

#1673

BREAKING CHANGE:

From now on, you will have to import your own adapter

Check out https://github.com/nextauthjs/adapters

The migration is super easy and has HUGE advantages for those not using TypeORM.

// [...nextauth].js
+ import TypeORMAdapter from "@next-auth/typeorm-legacy-adapter"
import NextAuth from "next-auth"

...
export default NextAuth({
-  database: "yourconnectionstring",
+ adapter: TypeORMAdapter("yourconnectionstring")
})

@github-actions github-actions bot added adapters Changes related to the core code concerning database adapters core Refers to `@auth/core` documentation Relates to documentation providers test Related to testing TypeScript Issues relating to TypeScript labels May 3, 2021
@kripod
Copy link
Contributor

kripod commented May 3, 2021

Whoa, this is more than awesome! I cannot wait to try it out very soon 🤩

Thank you for delivering all these improvements on a regular basis. Your contributions are invaluable to the Next.js ecosystem.

@vercel
Copy link

vercel bot commented May 5, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nextauthjs/next-auth/3TYKRVLEfSpMerCHsqoroKmjhYED
✅ Preview: https://next-auth-git-feat-rip-out-adapters-nextauthjs.vercel.app

@vercel vercel bot temporarily deployed to Preview May 5, 2021 21:11 Inactive
@vercel vercel bot temporarily deployed to Preview May 5, 2021 21:19 Inactive
@g10 g10 mentioned this pull request May 6, 2021
3 tasks
@vercel vercel bot temporarily deployed to Preview May 6, 2021 13:31 Inactive
@balazsorban44 balazsorban44 marked this pull request as ready for review June 8, 2021 23:59
Conflicts:
	README.md
	package-lock.json
	package.json
	src/adapters/index.js
	src/adapters/prisma.js
	src/adapters/typeorm.js
	src/server/index.js
	types/adapters.d.ts
	www/docs/adapters/prisma-legacy.md
	www/docs/configuration/databases.md
	www/docs/schemas/adapters.md
@vercel vercel bot temporarily deployed to Preview June 9, 2021 12:38 Inactive
@balazsorban44 balazsorban44 merged commit 960bc1e into next Jun 9, 2021
@balazsorban44 balazsorban44 deleted the feat/rip-out-adapters branch June 9, 2021 12:45
mnphpexpert added a commit to mnphpexpert/next-auth that referenced this pull request Sep 2, 2024
* feat(adapter): remove built-in adapters and database

BREAKING CHANGE:

From now on, you will have to import your own adapter

Check out https://github.com/nextauthjs/adapters

The migration is super easy and has HUGE advantages for those not using TypeORM.

```diff
// [...nextauth].js
+ import TypeORMAdapter from "@next-auth/typeorm-legacy-adapter"
import NextAuth from "next-auth"

...
export default NextAuth({
-  database: "yourconnectionstring",
+ adapter: TypeORMAdapter("yourconnectionstring")
})
```


Co-authored-by: Lluis Agusti <hi@llu.lu>
Co-authored-by: Giovanni Carnel <479046+g10@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters Changes related to the core code concerning database adapters core Refers to `@auth/core` documentation Relates to documentation providers test Related to testing TypeScript Issues relating to TypeScript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants