mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-23 18:43:18 +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 EmailProvider from "next-auth/providers/email";
|
||||||
import { PrismaClient } from "@prisma/client";
|
import { PrismaClient } from "@prisma/client";
|
||||||
import { getSubscriptionByEmail } from "../utils/subscription";
|
import { getSubscriptionByEmail } from "../utils/subscription";
|
||||||
|
import { hasFeature } from "@/utils";
|
||||||
|
|
||||||
const prisma = new PrismaClient();
|
const prisma = new PrismaClient();
|
||||||
|
|
||||||
// For more information on each option (and a full list of options) go to
|
// For more information on each option (and a full list of options) go to
|
||||||
// https://next-auth.js.org/configuration/options
|
// https://next-auth.js.org/configuration/options
|
||||||
export const authOptions: NextAuthOptions = {
|
export const authOptions: NextAuthOptions = {
|
||||||
adapter: PrismaAdapter(prisma),
|
adapter: hasFeature("account") ? PrismaAdapter(prisma) : undefined,
|
||||||
// https://next-auth.js.org/configuration/providers/oauth
|
// https://next-auth.js.org/configuration/providers/oauth
|
||||||
providers: [
|
providers: [
|
||||||
EmailProvider({
|
EmailProvider({
|
||||||
|
Reference in New Issue
Block a user