mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-07-25 16:12:42 +08:00
feat: only use prisma adaptor for nextauth if account feature enabled
Otherwise will cause db error
This commit is contained in:
@ -5,13 +5,14 @@ import { PrismaAdapter } from "@next-auth/prisma-adapter";
|
||||
import EmailProvider from "next-auth/providers/email";
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import { getSubscriptionByEmail } from "../utils/subscription";
|
||||
import { hasFeature } from "@/utils";
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
// For more information on each option (and a full list of options) go to
|
||||
// https://next-auth.js.org/configuration/options
|
||||
export const authOptions: NextAuthOptions = {
|
||||
adapter: PrismaAdapter(prisma),
|
||||
adapter: hasFeature("account") ? PrismaAdapter(prisma) : undefined,
|
||||
// https://next-auth.js.org/configuration/providers/oauth
|
||||
providers: [
|
||||
EmailProvider({
|
||||
|
Reference in New Issue
Block a user