Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prisma problem after sign in #12

Open
dennis2828 opened this issue Jun 5, 2023 · 3 comments
Open

Prisma problem after sign in #12

dennis2828 opened this issue Jun 5, 2023 · 3 comments

Comments

@dennis2828
Copy link

Hello there,I've got some problems with prisma after trying to sign in.It should redirect me to the /dashboard (http://localhost:3000/dashboard) but instead it redirects to a 404 page with the url of http://localhost:3000/login?callbackUrl=%2Fdashboard&error=Callback even if i have the dashboard page ready up.
Also there is a ton of errors from prisma after the sign in process such as "Invalid prisma.account.findUnique() invocation: {
where: {
provider_providerAccountId: {
~~~~~~~~~~~~~~~~~~~~~~~~~~
providerAccountId: '....',
provider: 'google'
}
},
select: {
user: true
}
}"

I also tried to change to exact same version of prisma, as the time i was watching the video,prisma have been updated their app and I do not know how to solve this. Thanks!

@alphawhiskey03
Copy link

i get this error as well. Found any solution?

@Olacdy
Copy link

Olacdy commented Jun 21, 2023

I had the similar problem, try to use these models:

model Account {
  id                 String  @id @default(cuid())
  userId             String
  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])
}

@kiritocode1
Copy link

yess this solution worked for me thanks @DBoFury

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants