Skip to content

docs(pg): clarify account uniqueness for account lookup#13416

Open
DbibihOthmane wants to merge 1 commit into
nextauthjs:mainfrom
DbibihOthmane:patch-2
Open

docs(pg): clarify account uniqueness for account lookup#13416
DbibihOthmane wants to merge 1 commit into
nextauthjs:mainfrom
DbibihOthmane:patch-2

Conversation

@DbibihOthmane
Copy link
Copy Markdown

☕️ Reasoning

The PostgreSQL adapter resolves linked accounts by querying the accounts table using provider and providerAccountId in getUserByAccount.

However, the schema example does not enforce or document a uniqueness constraint on this pair. This allows duplicate rows for the same account, which does not match the adapter’s lookup behavior and can lead to ambiguous results.

This change clarifies that a unique constraint on (provider, "providerAccountId") is expected for correct adapter behavior.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

N/A

Document the expected uniqueness on account lookup fields used by the Pg adapter. This keeps the schema example aligned with getUserByAccount.
@DbibihOthmane DbibihOthmane requested a review from ndom91 as a code owner April 16, 2026 16:54
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
auth-docs Ready Ready Preview, Comment Apr 16, 2026 4:58pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
next-auth-docs Ignored Ignored Preview Apr 16, 2026 4:58pm

Request Review

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

@DbibihOthmane is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

1 participant