JUNOHUB-test/src/auth.config.ts
2026-02-13 21:13:08 +05:00

27 lines
997 B
TypeScript

import type { NextAuthConfig } from "next-auth"
import Google from "next-auth/providers/google"
import Credentials from "next-auth/providers/credentials"
export default {
providers: [
Google({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
// Allow account linking: users can sign up/sign in with Google OAuth
// This enables Google sign-in to create new accounts or link to existing accounts with matching email
allowDangerousEmailAccountLinking: true,
}),
Credentials({
name: "Credentials",
credentials: {
email: { label: "Email", type: "email" },
password: { label: "Password", type: "password" },
},
// authorize is overridden in auth.ts where we have DB access
async authorize() {
return null
},
}),
],
} satisfies NextAuthConfig