Skip to content

Conversation

@balazsorban44
Copy link
Member

@balazsorban44 balazsorban44 commented Dec 13, 2023

Since this is a repetitive task that many adapters decided to do themselves, the parent libraries have been updated to not require adapters to generate an id themselves.

Before this can be merged:

BREAKING CHANGE:

The adapter now requires the parent library (either @auth/core or next-auth v4) to send the id property in the createUser method. Make sure to upgrade your parent library to their latest version.

The parent library generates the id via crypto.randomUUID(). If your custom adapter needs a different format, you can easily patch the createUser(method) to ignore the incoming id, or override it with your own type of id.

@vercel
Copy link

vercel bot commented Dec 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2023 3:02pm
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
auth-docs-nextra ⬜️ Ignored (Inspect) Visit Preview Dec 21, 2023 3:02pm
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Dec 21, 2023 3:02pm

@github-actions github-actions bot added adapters Changes related to the core code concerning database adapters dynamodb @auth/dynamodb-adapter neo4j @auth/neo4j-adapter pouchdb @auth/pouchdb-adapter upstash-redis @auth/upstash-redis-adapter typeorm @auth/typeorm-adapter drizzle @auth/drizzle-adapter kysely d1 azure-tables labels Dec 13, 2023
* fix: add default user id generation

* refactor: simplify `createUser` in adapters

* fix typeorm

* fix next-auth

* fix tests

* revert adapter changes

* revert

* revert

* simplify adapter util

* fix build errors
@ndom91
Copy link
Member

ndom91 commented Feb 12, 2024

Do you still plan on "backporting" this for v4?

I think with that recent "always set UUID to fallback user.id" PR in core, this could basically be good to go for v5.

What do you think?

@stale
Copy link

stale bot commented Jan 31, 2025

It looks like this issue did not receive any activity for 60 days. It will be closed in 7 days if no further activity occurs. If you think your issue is still relevant, commenting will keep it open. Thanks!

@stale stale bot added the stale Did not receive any activity for 60 days label Jan 31, 2025
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 azure-tables d1 drizzle @auth/drizzle-adapter dynamodb @auth/dynamodb-adapter kysely mongodb @auth/mongodb-adapter neo4j @auth/neo4j-adapter pouchdb @auth/pouchdb-adapter stale Did not receive any activity for 60 days typeorm @auth/typeorm-adapter upstash-redis @auth/upstash-redis-adapter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants