mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-26 01:23:18 +08:00
chore: add next-auth-provider only if account is enabled
This commit is contained in:
@ -14,7 +14,8 @@ const prisma = new PrismaClient();
|
|||||||
export const authOptions: NextAuthOptions = {
|
export const authOptions: NextAuthOptions = {
|
||||||
adapter: hasFeature("account") ? PrismaAdapter(prisma) : undefined,
|
adapter: hasFeature("account") ? PrismaAdapter(prisma) : undefined,
|
||||||
// https://next-auth.js.org/configuration/providers/oauth
|
// https://next-auth.js.org/configuration/providers/oauth
|
||||||
providers: [
|
providers: hasFeature("account")
|
||||||
|
? [
|
||||||
EmailProvider({
|
EmailProvider({
|
||||||
server: process.env.EMAIL_SERVER,
|
server: process.env.EMAIL_SERVER,
|
||||||
from: "noreply@sqlchat.ai",
|
from: "noreply@sqlchat.ai",
|
||||||
@ -28,7 +29,8 @@ export const authOptions: NextAuthOptions = {
|
|||||||
clientId: process.env.GITHUB_ID,
|
clientId: process.env.GITHUB_ID,
|
||||||
clientSecret: process.env.GITHUB_SECRET,
|
clientSecret: process.env.GITHUB_SECRET,
|
||||||
}),
|
}),
|
||||||
],
|
]
|
||||||
|
: [],
|
||||||
cookies: {
|
cookies: {
|
||||||
sessionToken: {
|
sessionToken: {
|
||||||
name: `next-auth.session-token`,
|
name: `next-auth.session-token`,
|
||||||
|
Reference in New Issue
Block a user