adapter_error_linkAccount ::: @next-auth/typeorm-legacy-adapter #5302
Unanswered
lunaticscode
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Adapter type
@next-auth/typeorm-legacy-adapter
Environment
System:
OS: macOS 12.5
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 1.04 GB / 32.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
Browsers:
Chrome: 105.0.5195.102
Safari: 15.6
npmPackages:
next: 12.2.5 => 12.2.5
next-auth: ^4.10.3 => 4.10.3
react: 18.2.0 => 18.2.0
Reproduction URL
Just Local-project
Describe the issue
[logger -error]
code: 'adapter_error_linkAccount'
metadata: QueryFailedError: ER_DATA_TOO_LONG: Data too long for column 'id_token' at row 1
========================================================
I was looking for a solution to this issue then I found that there was a problem with the ORM applied to this adapter library.
If ORM is applied without creating an custom entity file, MySQL or MariaDB probably set the default maximum length of varchar type to 255, so the data length of the 'id_token' column of the account table cannot be accommodated.
So, by creating the custom entity file and modifying the length of the 'id_token' column to about 1500, the issue was resolved.
I think maybe this problem is something that needs to be solved from the library side.
How to reproduce
Following this guide,
https://next-auth.js.org/adapters/typeorm
(DB: MySQL 8.x or MariaDB 10.x)
Exec signIn process.
Expected behavior
[logger - error]
code: 'adapter_error_linkAccount',
metadata: QueryFailedError: ER_DATA_TOO_LONG: Data too long for column 'id_token' at row 1
.
.
.
.
driverError: Error: ER_DATA_TOO_LONG: Data too long for column 'id_token' at row 1
.
.
.
code: 'ER_DATA_TOO_LONG',
errno: 1406,
sqlMessage: "Data too long for column 'id_token' at row 1",
sqlState: '22001',
.
.
.
Beta Was this translation helpful? Give feedback.
All reactions