nextauthjs / next-auth

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

fix(drizzle): update schema type & fix issue with default id #10750

Closed realmikesolo closed 1 week ago

realmikesolo commented 2 weeks ago

Made tables for adapter optional cause not all of them are used for authentication strategies. Also I exlcuded id from data coming from Authjs in createUser function to enable setting default id as defined in Drizzle table.

☕️ Reasoning

  1. Default id was overwritten by one coming from Authjs;
  2. Not all tables are used for next-auth.

🧢 Checklist

vercel[bot] commented 2 weeks ago

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 May 8, 2024 4:10pm
1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **next-auth-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/authjs/next-auth-docs/FA33qdJ87pgY99PPYb9RRC2PCzc6)) | [Visit Preview](https://next-auth-docs-git-fork-realmikesolo-main-authjs.vercel.app) | | May 8, 2024 4:10pm |
vercel[bot] commented 2 weeks ago

@ndom91 is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

socket-security[bot] commented 2 weeks ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/set-cookie-parser@2.6.0 None 0 15.8 kB nfriedly

🚮 Removed packages: npm/@actions/core@1.10.1, npm/@ariakit/react@0.4.5, npm/@auth/prisma-adapter@2.0.0, npm/@auth/sveltekit@1.0.1, npm/@auth/unstorage-adapter@2.0.0, npm/@aws-sdk/client-dynamodb@3.499.0, npm/@aws-sdk/lib-dynamodb@3.499.0, npm/@azure/data-tables@13.2.2, npm/utils@0.0.0

View full report↗︎

socket-security[bot] commented 2 weeks ago

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

srigi commented 2 weeks ago

+1 on this, as I'm also not using INT or UUID for PKs in my tables and this would unblock the whole project moving forward.

ndom91 commented 2 weeks ago

Okay nice, looks better to me. Tests all pass as well. @juliusmarminge you want to take one last look over it before I merge it? :pray:

JipSterk commented 1 week ago

Do we still want to use AdapterAccount['type'] in the tests?