Give NextAuth access to a catch-all
Course: Next Auth - chapter 5
Ref https://next-auth.js.org/configuration/initialization#route-handlers-app
- Create
/api/auth/[…nextauth]/route.ts - Install next-auth
npm install next-auth- Updated handler
import NextAuth from "next-auth"
const handler = NextAuth({ ...})
export { handler as GET, handler as POST }- Adding providers - There are three broad types of providers
- OAuth (Login with google)
- Email (Passwordless Email login via email OTP)
- Credentials (your own strategy) Let’s them one by one