-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat(adapter): take away error handling from adapters #1871
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nextauthjs/next-auth/3wcqomtEk3nVnTTJhRoKDky8WLP8 |
const adapterMethod = adapter[method] | ||
acc[method] = async (...args) => { | ||
try { | ||
return await adapterMethod(...args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should log out args with debug, and an adapter prefix(?)
@kripod, currently logger.debug
is rewritten in adapters to include a prefix for code
. Do you think we could return a name property next to getAdapter for this purpose?
any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may specify an attribute like { displayName: string }
as the minimum required config
param when instantiating adapters. By doing so, we would also solve the typing issue of Adapter(requiredParam, …)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After my recent commit, it will be possible for adapters to return a displayName
property in getAdapter
. Unfortunately we don't have the adapter configuration when we invoke the .getAdapter()
method.
4572912
to
3524264
Compare
Currently waiting for @kripod and his results after testing these changes in production. We expect fewer unhandled errors. |
Reasoning 💡
What changes are being made? What feature/bug is being fixed here?
Checklist 🧢
Feel free cross items ( like this
~[] item~
) if they're irrelevant to your changes.To check an item, place an
x
in the box like so:- [x] Documentation
.Affected issues 🎟
#1832