mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-25 09:03:43 +08:00
chore: add next-auth-provider only if account is enabled
This commit is contained in:
@ -14,21 +14,23 @@ 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({
|
? [
|
||||||
server: process.env.EMAIL_SERVER,
|
EmailProvider({
|
||||||
from: "noreply@sqlchat.ai",
|
server: process.env.EMAIL_SERVER,
|
||||||
// maxAge: 24 * 60 * 60, // How long email links are valid for (default 24h)
|
from: "noreply@sqlchat.ai",
|
||||||
}),
|
// maxAge: 24 * 60 * 60, // How long email links are valid for (default 24h)
|
||||||
GoogleProvider({
|
}),
|
||||||
clientId: process.env.GOOGLE_CLIENT_ID,
|
GoogleProvider({
|
||||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
clientId: process.env.GOOGLE_CLIENT_ID,
|
||||||
}),
|
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
|
||||||
GithubProvider({
|
}),
|
||||||
clientId: process.env.GITHUB_ID,
|
GithubProvider({
|
||||||
clientSecret: process.env.GITHUB_SECRET,
|
clientId: process.env.GITHUB_ID,
|
||||||
}),
|
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