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

Please change the prisma adapter Account providerType to type and providerId to provider #7689

Closed
wants to merge 130 commits into from

Conversation

Kailash8799
Copy link

Hello this is a small issue in google login auth in next auth when we are copy code which are given in next-auth docs this will be give you error please change the below code

model Account {
id String @id @default(cuid())
userId String
providerType String
providerId String
providerAccountId String
refreshToken String?
accessToken String?
accessTokenExpires DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id])

@@unique([providerId, providerAccountId])
}

change above code to below code

model Account{
id String @id @default(auto()) @Map("_id") @db.ObjectId
userId String @db.ObjectId
type String
provider String
providerAccountId String
refresh_token String? @db.String
access_token String? @db.String
expires_at Int?
token_type String?
scope String?
id_token String? @db.String
session_state String?

user User @relation(fields: [userId],references: [id],onDelete:Cascade)
@@unique([provider,providerAccountId])
}

boredland and others added 30 commits March 14, 2023 13:29
* Adding correct sveltekit client doc links.

* Updating urls for sveltekit index.
* docs(fauna): move content to source

* chore: fix spelling

* Apply suggestions from code review

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
Co-authored-by: Anti Revoluzzer <anti@siimpl.io>
BREAKING CHANGE:
Complete rewrite of the package. It is now published as ESM-only and written for `next-auth@4`. `next-auth@3` support is removed.

---------

Co-authored-by: Balázs Orbán <info@balazsorban.com>
* remove unmaintained changelogs

* move logos to docs

* unify readmes

* fix logo urls
@vercel
Copy link

vercel bot commented May 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview May 31, 2023 7:41am
2 Ignored Deployments
Name Status Preview Updated (UTC)
auth-docs-nextra ⬜️ Ignored (Inspect) May 31, 2023 7:41am
next-auth-docs ⬜️ Ignored (Inspect) May 31, 2023 7:41am

@github-actions github-actions bot added adapters Changes related to the core code concerning database adapters core Refers to `@auth/core` dgraph @auth/dgraph-adapter dynamodb @auth/dynamodb-adapter examples fauna @auth/fauna-adapter firebase @auth/firebase-adapter frameworks legacy Refers to `next-auth` v4. Minimal maintenance. mikro-orm @auth/mikro-orm-adapter mongodb @auth/mongodb-adapter neo4j @auth/neo4j-adapter playgrounds pouchdb @auth/pouchdb-adapter prisma @auth/prisma-adapter providers sequelize @auth/sequelize-adapter solidjs supabase @auth/supabase-adapter svelte typeorm-legacy upstash-redis @auth/upstash-redis-adapter xata @auth/xata-adapter labels May 31, 2023
@balazsorban44
Copy link
Member

Hi, this PR was likely opened by mistake.

Anyway, the suggested change probably wouldn't make it, since the Account model already has a provider field as you can see in https://authjs.dev/reference/adapters#models

And type might be a field returned by providers, so it would crash if renamed providerType.

Thanks though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters Changes related to the core code concerning database adapters core Refers to `@auth/core` dgraph @auth/dgraph-adapter dynamodb @auth/dynamodb-adapter examples fauna @auth/fauna-adapter firebase @auth/firebase-adapter frameworks legacy Refers to `next-auth` v4. Minimal maintenance. mikro-orm @auth/mikro-orm-adapter mongodb @auth/mongodb-adapter neo4j @auth/neo4j-adapter playgrounds pouchdb @auth/pouchdb-adapter prisma @auth/prisma-adapter providers sequelize @auth/sequelize-adapter solidjs supabase @auth/supabase-adapter svelte typeorm-legacy upstash-redis @auth/upstash-redis-adapter xata @auth/xata-adapter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet