Course lesson

Migrate Next.js Pages Auth API Handler to App Router

We start moving our pages api routes to the app router we move our auth handler for Next Auth to the app router.

Duration
4 min
Access
Free
Transcript
Retained from source evidence

We start moving our pages api routes to the app router we move our auth handler for Next Auth to the app router.

There isn't anything that we need to change to the actual code of the API handler but the way the API route is set up in the app router is a little different.

We'll rename our file to routes.ts and make sure to export the correct HTTP methods from the route.