Replies: 1 comment
-
Trying to clear this up in the next version of the docs, I hope this helps: https://next-auth-git-next-nextauthjs.vercel.app/adapters/models |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question 💬
I saw from another GitHub issue that the database schema includes users, sessions and accounts. A user may have multiple sessions (ie., logging in from multiple devices since each device has its own cookie, thus it needs its own session), and a user may have multiple accounts (login through different OAuth providers). But how does the system get into a permutation where a user has multiple accounts and what the rules that links an account to a user? For example, is it simply the email field? I read in other places that next-auth does not link across OAuth accounts for security purposes. How then, can a user object have multiple accounts? And finally, which data attribute should developers use as the "source of truth" to identify a user? Should the application use the _id field from the users table, or the _id field from the accounts table (which has a reference to the user table by _id). Thank you for the wonderful library.
How to reproduce ☕️
This is a purely conceptual question based on the schema definitions.
Contributing 🙌🏽
No, I am afraid I cannot help regarding this
Beta Was this translation helpful? Give feedback.
All reactions