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
Add additional type #4402
Add additional type #4402
Conversation
`NextRequst` type is for nextjs `_middleware.ts`
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Thanks 💚
I think it makes sense as with the introduction of middleware, getToken
can also be called with this context.
Now that you're at it, do you mind updating this line here?
https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/next/middleware.ts#L84
We won't need the cast to any
anymore 💆🏽♂️
Thank you for checking my PR :) I agree with what you mentioned! I remove |
@lluia I updated the code to import |
Reasoning 💡
I'm trying to use
getToken
function in_middleware.ts
but it complains because req type only hasNextApiRequest | Pick<NextApiRequest, "cookies" | "headers">
.Checklist 🧢
NextRequst
type for nextjs_middleware.ts
Yes
Affected issues 🎟
I don't think it affects something else.