feat(auth): add self-host Gitea provider for authentication and update Next.js config for remote images

This commit is contained in:
ngc2207 2024-12-29 16:20:36 +08:00
parent 0c15dcf7de
commit bb4fb0639b
2 changed files with 12 additions and 1 deletions

View File

@ -11,6 +11,10 @@ const nextConfig: NextConfig = {
protocol: "https", protocol: "https",
hostname: "seccdn.libravatar.org", hostname: "seccdn.libravatar.org",
}, },
{
protocol: "http",
hostname: "localhost",
},
], ],
}, },
}; };

View File

@ -6,5 +6,12 @@ import { PrismaAdapter } from "@auth/prisma-adapter";
export const { handlers, signIn, signOut, auth } = NextAuth({ export const { handlers, signIn, signOut, auth } = NextAuth({
adapter: PrismaAdapter(prisma), adapter: PrismaAdapter(prisma),
providers: [GitHub, Gitea], providers: [
GitHub,
Gitea({
enterprise: {
baseUrl: process.env.GITEA_BASE_URL,
},
}),
],
}); });