diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 9ec7aeb..9e904c4 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -11,18 +11,18 @@ datasource db { } model User { - id String @id @default(cuid()) - name String? - email String? @unique - emailVerified DateTime? - image String? - hashedPassword String? - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt - - accounts Account[] - File File[] - Message Message[] + id String @id @default(uuid()) + name String? + email String? @unique + emailVerified DateTime? + image String? + hashedPassword String? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + accounts Account[] + File File[] + Message Message[] stripeCustomerId String? @unique @map(name: "stripe_customer_id") stripeSubscriptionId String? @unique @map(name: "stripe_subscription_id") stripePriceId String? @map(name: "stripe_price_id") @@ -30,25 +30,25 @@ model User { } model Account { - id String @id @default(cuid()) - userId String - type String - provider String - providerAccountId String - refresh_token String? - access_token String? - expires_at Int? - token_type String? - scope String? - id_token String? - session_state String? - + id String @id @default(uuid()) + userId String + type String + provider String + providerAccountId String + refresh_token String? + access_token String? @db.Text + expires_at Int? + token_type String? + scope String? + id_token String? @db.Text + session_state String? + + // Relation user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@unique([provider, providerAccountId]) } - enum UploadStatus { PENDING PROCESSING diff --git a/src/pages/api/auth/[...nextauth].ts b/src/pages/api/auth/[...nextauth].ts index 94f4753..93838a8 100644 --- a/src/pages/api/auth/[...nextauth].ts +++ b/src/pages/api/auth/[...nextauth].ts @@ -11,11 +11,13 @@ export const authOptions: AuthOptions = { providers: [ GithubProvider({ clientId: process.env.THIRT_GITHUB_ID as string, - clientSecret: process.env.THIRT_GITHUB_SECRET as string + clientSecret: process.env.THIRT_GITHUB_SECRET as string, + allowDangerousEmailAccountLinking: true }), GoogleProvider({ clientId: process.env.GOOGLE_CLIENT_ID as string, - clientSecret: process.env.GOOGLE_CLIENT_SECRET as string + clientSecret: process.env.GOOGLE_CLIENT_SECRET as string, + allowDangerousEmailAccountLinking: true }), CredentialsProvider({ name: 'credentials',