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
The second argument to "authorize" in a CredentialsProvider is request, of type RequestInternal. I want to access values from the header/method on this for logging purposes. In prior versions this worked fine. After updating to recent versions though, it seems in "credentials.d.ts" CredentialsConfig.authorize has its second argument for RequestInternal imported from '../core'. Looking at that file though (core.d.ts), there is no RequestInternal export. Thus RequestInternal types as any, making my accesses unsafe.
It seems like core/src/index.ts was meant to export it (since credentials imports it), but only imports it
How to reproduce ☕️
const opt: NextAuthOptions = {
providers: [
CredentialProvider({
credentials: {},
authorize: async (cred, req) => {
const method: string = req.method; // this triggers lint warnings as method is typed as any, when it should be string
return null;
},
}),
],
};
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
The text was updated successfully, but these errors were encountered:
Hi, #6132 (comment) could you test out this version to see if it fixes your issue? If it does, it will be included in the next release once the PR is merged!
Question 💬
The second argument to "authorize" in a CredentialsProvider is request, of type
RequestInternal
. I want to access values from the header/method on this for logging purposes. In prior versions this worked fine. After updating to recent versions though, it seems in "credentials.d.ts" CredentialsConfig.authorize has its second argument forRequestInternal
imported from '../core'. Looking at that file though (core.d.ts), there is no RequestInternal export. Thus RequestInternal types as any, making my accesses unsafe.It seems like core/src/index.ts was meant to export it (since credentials imports it), but only imports it
How to reproduce ☕️
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
The text was updated successfully, but these errors were encountered: