Prisma and callback error
Unanswered
Semipalmated Plover posted this in #help-forum
Semipalmated PloverOP
in my Nextjs app im trying to redirect after session nextauthjs to the home page which doesnt work and i get nothig as error only that login with other account
and in console
[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR]
https://next-auth.js.org/errors#oauth_callback_handler_error Cannot read properties of undefined (reading 'findUnique') TypeError: Cannot read properties of undefined (reading 'findUnique')
at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@auth/prisma-adapter/index.js:220:45)
but as i checked 100 time all the ID and SEcrets are looking fine
import GithubProvider from "next-auth/providers/github";
import GoogleProvider from "next-auth/providers/google";
import prisma from "./connect";
import { PrismaAdapter } from "@auth/prisma-adapter";
export const authOptions = {
adapter: PrismaAdapter(prisma),
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
}),
GithubProvider({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
],
};
and in console
[next-auth][error][OAUTH_CALLBACK_HANDLER_ERROR]
https://next-auth.js.org/errors#oauth_callback_handler_error Cannot read properties of undefined (reading 'findUnique') TypeError: Cannot read properties of undefined (reading 'findUnique')
at getUserByAccount (webpack-internal:///(rsc)/./node_modules/@auth/prisma-adapter/index.js:220:45)
but as i checked 100 time all the ID and SEcrets are looking fine
import GithubProvider from "next-auth/providers/github";
import GoogleProvider from "next-auth/providers/google";
import prisma from "./connect";
import { PrismaAdapter } from "@auth/prisma-adapter";
export const authOptions = {
adapter: PrismaAdapter(prisma),
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_ID,
clientSecret: process.env.GOOGLE_SECRET,
}),
GithubProvider({
clientId: process.env.GITHUB_ID,
clientSecret: process.env.GITHUB_SECRET,
}),
],
};