[GH-ISSUE #846] idToken column is missing in Prisma Adapter #8463

Closed
opened 2026-04-13 03:32:08 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @piotrkulpinski on GitHub (Dec 10, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/846

Hi,

I'm testing this library and hit a roadblock while trying to implement the Prisma adapter.

I've followed the schema described in the docs and ported it to prisma.schema:

model User {
  id            String   @id @default(cuid())
  name          String
  email         String   @unique
  emailVerified Boolean  @default(false)
  image         String?
  createdAt     DateTime @default(now())
  updatedAt     DateTime @updatedAt

  // Relations
  accounts     Account[]
  sessions     Session[]
}

model Session {
  id        String   @id @default(cuid())
  userId    String
  expiresAt DateTime
  ipAddress String?
  userAgent String?
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

  // Relations
  user User @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@index([userId])
}

model Account {
  id                    String    @id @default(cuid())
  userId                String
  accountId             String
  providerId            String
  accessToken           String?
  refreshToken          String?
  accessTokenExpiresAt  DateTime?
  refreshTokenExpiresAt DateTime?
  scope                 String?
  password              String?
  createdAt             DateTime  @default(now())
  updatedAt             DateTime  @updatedAt

  // Relations
  user User @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@index([userId])
}

model Verification {
  id         String   @id @default(cuid())
  identifier String
  value      String
  expiresAt  DateTime
  createdAt  DateTime @default(now())
  updatedAt  DateTime @updatedAt
}

The problem is that if I try to sign up with Google social provider, it tries to put a column idToken into the database which is missing. Is this just a mistake in the docs or am I missing something?

Thanks

EDIT: same with the token field missing on the Session table.

Originally created by @piotrkulpinski on GitHub (Dec 10, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/846 Hi, I'm testing this library and hit a roadblock while trying to implement the Prisma adapter. I've followed the schema described in the [docs](https://www.better-auth.com/docs/concepts/database#core-schema) and ported it to prisma.schema: ```prisma model User { id String @id @default(cuid()) name String email String @unique emailVerified Boolean @default(false) image String? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt // Relations accounts Account[] sessions Session[] } model Session { id String @id @default(cuid()) userId String expiresAt DateTime ipAddress String? userAgent String? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt // Relations user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@index([userId]) } model Account { id String @id @default(cuid()) userId String accountId String providerId String accessToken String? refreshToken String? accessTokenExpiresAt DateTime? refreshTokenExpiresAt DateTime? scope String? password String? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt // Relations user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@index([userId]) } model Verification { id String @id @default(cuid()) identifier String value String expiresAt DateTime createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } ``` The problem is that if I try to sign up with Google social provider, it tries to put a column `idToken` into the database which is missing. Is this just a mistake in the docs or am I missing something? Thanks EDIT: same with the `token` field missing on the `Session` table.
GiteaMirror added the locked label 2026-04-13 03:32:08 -05:00
Author
Owner

@Bekacru commented on GitHub (Dec 11, 2024):

Hey make sure you're on the latest version of the library. This schema is outdated since v1. try using the cli with the new version and you could also just manually add the missing fields from the docs https://www.better-auth.com/docs/concepts/database#core-schema

<!-- gh-comment-id:2535567676 --> @Bekacru commented on GitHub (Dec 11, 2024): Hey make sure you're on the latest version of the library. This schema is outdated since v1. try using the cli with the new version and you could also just manually add the missing fields from the docs https://www.better-auth.com/docs/concepts/database#core-schema
Author
Owner

@draylegend commented on GitHub (Dec 18, 2024):

using v1.0.22. Working fine with google social provider

<!-- gh-comment-id:2551173435 --> @draylegend commented on GitHub (Dec 18, 2024): using v1.0.22. Working fine with google social provider
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8463