You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this project!
I was implementing a custom adapter and I want to share my thoughts about the DefaultAdapter interface:
getUserByAccount and unlinkAccount both have a parameter named providerAccountId, but according to the interface it's an object with two fields. Confusing.
updateUser payload is Partial<AdapterUser>, but how to update without the required user id.
unlinkAccount doesn't have null in the type union of returned Promise (and does have undefined), but all other similar methods do have null.
It is unclear why some methods have Promise<void> in return union.
It is unclear whether the library performs any checks strictly against null and undefined when both appear in the return Promise type union, and which one expected to be returned in what situation.
How to reproduce
Not eligible
Expected behavior
Someone with strong knowledge of how this library works might go through this, filter out relevant suggestions, and safely improve the interface or/and documentation.
adaptersChanges related to the core code concerning database adapterstriageUnseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
1 participant
Converted from issue
This discussion was converted from issue #5540 on October 10, 2022 23:55.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Adapter type
Custom adapter
Environment
No impact
Reproduction URL
https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/adapters.ts#L79
Describe the issue
Thank you for this project!
I was implementing a custom adapter and I want to share my thoughts about the
DefaultAdapter
interface:getUserByAccount
andunlinkAccount
both have a parameter namedproviderAccountId
, but according to the interface it's an object with two fields. Confusing.updateUser
payload isPartial<AdapterUser>
, but how to update without the required userid
.unlinkAccount
doesn't havenull
in the type union of returned Promise (and does haveundefined
), but all other similar methods do havenull
.Promise<void>
in return union.null
andundefined
when both appear in the return Promise type union, and which one expected to be returned in what situation.How to reproduce
Not eligible
Expected behavior
Someone with strong knowledge of how this library works might go through this, filter out relevant suggestions, and safely improve the interface or/and documentation.
Beta Was this translation helpful? Give feedback.
All reactions