nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
22.49k stars 2.98k forks source link

fix(dgraph): id generation overlap #10719

Open korzhanov opened 3 weeks ago

korzhanov commented 3 weeks ago

☕️ Reasoning

Dgraph will generate the ID by itself. In Dgraph, every node has a unique 64-bit identifier that you can expose in GraphQL using the ID type. An ID is auto-generated, immutable and never reused. Each type can have at most one ID field.

The ID type works great when you need to use an identifier on nodes and don’t need to set that identifier externally DGraph type docs

Since next-auth.js or auth.js creates a new user id, this causes an error and does not save the entry to dgraph

🧢 Checklist

🎫 Affected issues

📌 Resources

vercel[bot] commented 3 weeks ago

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

Name Status Preview Comments Updated (UTC)
auth-docs ❌ Failed (Inspect) Apr 24, 2024 9:24pm
1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **next-auth-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/authjs/next-auth-docs/FF3GwYgho762PfhWr73moLf6D1g2)) | [Visit Preview](https://next-auth-docs-git-fork-korzhanov-main-authjs.vercel.app) | | Apr 24, 2024 9:24pm |
ndom91 commented 2 weeks ago

Just curious why the current tests pass and why this isn't necessary for createSession or createVerificationToken, for example, then? :thinking: