Open Soso966 opened 1 year ago
@next-auth/sequelize-adapter
System: OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish) CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz Memory: 2.05 GB / 7.66 GB Container: Yes Shell: 5.8.1 - /usr/bin/zsh Binaries: Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
npmPackages: @next-auth/sequelize-adapter: ^1.0.8 => 1.0.8
localhost
Okay, my issue as follows: I tried to connect my models from Next auth with my models on the backend server.
When I login via Google Provider, it returns my data with email_verified in {account,profile} objects,
and when passing it to the adapter it shows on CreateUser
The User model expects the email_verified value to be returned, but it returns null, instead of true/false.
I wrote it above
adapter: SequelizeAdapter(sequelize,{ models:{ User: sequelize.define("users",{ ...models.User, emailVerified: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: true, field: 'email_verified' }, email_verified: { type: DataTypes.BOOLEAN, allowNull: false, defaultValue: true, field: 'email_verified' } }) , },
It should sync the models and their columns
You should explicitly call sync as per documentation. https://authjs.dev/reference/adapter/sequelize#synchronize
Adapter type
@next-auth/sequelize-adapter
Environment
System: OS: Linux 5.15 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish) CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz Memory: 2.05 GB / 7.66 GB Container: Yes Shell: 5.8.1 - /usr/bin/zsh Binaries: Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
npmPackages: @next-auth/sequelize-adapter: ^1.0.8 => 1.0.8
Reproduction URL
localhost
Describe the issue
Okay, my issue as follows: I tried to connect my models from Next auth with my models on the backend server.
When I login via Google Provider, it returns my data with email_verified in {account,profile} objects,![image](https://github.com/nextauthjs/next-auth/assets/133384475/d577f6ef-60d3-4fe5-b737-848e86d3f97b)
and when passing it to the adapter it shows on CreateUser
The User model expects the email_verified value to be returned, but it returns null, instead of true/false.![image](https://github.com/nextauthjs/next-auth/assets/133384475/c0b4a60f-5dfa-4ffd-bae9-db7eafdc381f)
How to reproduce
I wrote it above
Expected behavior
It should sync the models and their columns