Open ZzyzxIsAlreadyTaken opened 1 month ago
I have the same problem, have u fixed it?
If you generated template with t3, try modifying your sqlite schema like this https://github.com/ZzyzxIsAlreadyTaken/monthly/commit/385c95aecd8993a9616c017711dba425adea7c34
Yeah mbilenko-florio has the fix. I reported it in T3 aswell. The error is the same with some other adapters, and with similar solutions. My github and databse schema should be updated with the solution.
Adapter type
@auth/drizzle-adapter
Environment
System: OS: macOS 14.5 CPU: (12) arm64 Apple M2 Max Memory: 53.95 MB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm Browsers: Chrome: 125.0.6422.142 Safari: 17.5 npmPackages: @auth/drizzle-adapter: ^1.1.0 => 1.2.0 next: ^14.2.1 => 14.2.3 next-auth: ^4.24.7 => 4.24.7 react: ^18.3.0 => 18.3.1
Reproduction URL
https://github.com/ZzyzxIsAlreadyTaken/monthly
Describe the issue
[next-auth][debug][adapter_getUserByEmail] { args: [ 'somemail@hotmail.com' ] } [next-auth][debug][adapter_createUser] { args: [ { name: 'someusername', email: 'somemail@hotmail.com', image: 'https://cdn.discordapp.com/embed/avatars/0.png', emailVerified: null } ] } [next-auth][error][adapter_error_createUser] https://next-auth.js.org/errors#adapter_error_createuser NOT NULL constraint failed: monthly_user.id { message: 'NOT NULL constraint failed: monthly_user.id',
Also getting this:
Turned on debugging in nexauth options and is getting the same error both with discord and google providers. Both are getting the users, but creating database entry fails with no userid beeing updated.
How to reproduce
Create T3 app with sqlite and drizzle, set up basic client id, secret and callback for Discord and Google.
Expected behavior
User beeing created in db, and login succeded