Google authentication not working on my Nextjs app
I've tried implementing the google authentication on my nextjs app but I keep getting the error below:
POST /api/auth/sign-in/social 500 in 525ms
⨯ TypeError: Cannot read properties of undefined (reading 'handler')
at [project]/app/api/auth/[...all]/route.ts [app-route] (ecmascript) (app/api/auth/[...all]/route.ts:5:50)
at Object.<anonymous> (.next/server/app/api/auth/[...all]/route.js:12:9)
3 | import { auth } from '@/lib/auth';
4 |
page: '/api/auth/sign-in/social'
}
POST /api/auth/sign-in/social 500 in 525ms
⨯ TypeError: Cannot read properties of undefined (reading 'handler')
at [project]/app/api/auth/[...all]/route.ts [app-route] (ecmascript) (app/api/auth/[...all]/route.ts:5:50)
at Object.<anonymous> (.next/server/app/api/auth/[...all]/route.js:12:9)
3 | import { auth } from '@/lib/auth';
4 |
5 | export const { GET, POST } = toNextJsHandler(auth.handler);| ^ {
page: '/api/auth/sign-in/social'
}