0

I am trying to use the NextAuth/Auth.js Patreon Adapter and am able to at least display the sign in button however, after authenticating with Patreon, I get an error during the callback.

prisma:error 
Invalid `prisma.user.create()` invocation:


The provided value for the column is too long for the column's type. Column: for
[next-auth][error][adapter_error_createUser] 
https://next-auth.js.org/errors#adapter_error_createuser 
Invalid `prisma.user.create()` invocation:


The provided value for the column is too long for the column's type. Column: for {
  message: '\n' +
    'Invalid `prisma.user.create()` invocation:\n' +
    '\n' +
    '\n' +
    "The provided value for the column is too long for the column's type. Column: for",
  stack: 'Error: \n' +
    'Invalid `prisma.user.create()` invocation:\n' +
    '\n' +
    '\n' +
    "The provided value for the column is too long for the column's type. Column: for\n" +
    '    at Zr.handleRequestError (/var/task/node_modules/.pnpm/@prisma+client@4.11.0_prisma@4.11.0/node_modules/@prisma/client/runtime/library.js:171:6414)\n' +
    '    at Zr.handleAndLogRequestError (/var/task/node_modules/.pnpm/@prisma+client@4.11.0_prisma@4.11.0/node_modules/@prisma/client/runtime/library.js:171:5948)\n' +
    '    at Zr.request (/var/task/node_modules/.pnpm/@prisma+client@4.11.0_prisma@4.11.0/node_modules/@prisma/client/runtime/library.js:171:5786)\n' +
    '    at async t._request (/var/task/node_modules/.pnpm/@prisma+client@4.11.0_prisma@4.11.0/node_modules/@prisma/client/runtime/library.js:174:10455)',
  name: 'Error'
}

This is the schema which is mostly untouched from when the project was generated

// Necessary for Next auth
model Account {
    id                String  @id() @default(cuid())
    userId            String @db.Text
    type              String
    provider          String
    providerAccountId String
    refresh_token     String? @db.Text
    access_token      String? @db.Text
    expires_at        Int?
    token_type        String?
    scope             String?
    id_token          String? @db.Text
    session_state     String?
    user              User    @relation(fields: [userId], references: [id], onDelete: Cascade)

    @@unique([provider, providerAccountId])
}

model Session {
    id           String   @id @default(cuid())
    sessionToken String   @unique
    userId       String
    expires      DateTime
    user         User     @relation(fields: [userId], references: [id], onDelete: Cascade)
}

model User {
    id            String    @id() @default(cuid())
    name          String?
    email         String?   @unique
    emailVerified DateTime?
    image         String?
    accounts      Account[]
    sessions      Session[]
}

model VerificationToken {
    identifier String
    token      String   @unique
    expires    DateTime

    @@unique([identifier, token])
}

What am I doing wrong here?

Flakenstine
  • 25
  • 1
  • 9
  • There are a few related questions that would help https://stackoverflow.com/questions/75990395/how-to-fix-a-prisma-linkaccounterror-the-provided-value-for-the-column-is-too-l#comment134038936_75990395 https://stackoverflow.com/questions/75866611/next-auth-cannot-login-prisma-adapter-planet-scale-google#comment133826049_75866611 – Nurul Sundarani May 02 '23 at 19:58

0 Answers0