How to properly use protected api routes in Next.js? #2376
Unanswered
ronaldruzicka
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I would like to ask how to properly use protected API Routes in Next.js using Next.js SDK.
In the migration guide from v3 to v4 you mention that withApiAuthRequired has been removed from the SDK, but it’s still there. And it is also used as an example of how to protect API routes in App router.
But when I actually use it, it shows me this typescript error:
I can type it like this, but the NextApiHandleris not for App router API routes is it?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions