From bb4fb0639bad9194884f40f6a4999b6b90c41505 Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Sun, 29 Dec 2024 16:20:36 +0800 Subject: [PATCH] feat(auth): add self-host Gitea provider for authentication and update Next.js config for remote images --- next.config.ts | 4 ++++ src/auth.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/next.config.ts b/next.config.ts index 49e5c6a..aa7c1ca 100644 --- a/next.config.ts +++ b/next.config.ts @@ -11,6 +11,10 @@ const nextConfig: NextConfig = { protocol: "https", hostname: "seccdn.libravatar.org", }, + { + protocol: "http", + hostname: "localhost", + }, ], }, }; diff --git a/src/auth.ts b/src/auth.ts index 0151999..7c36e5d 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -6,5 +6,12 @@ import { PrismaAdapter } from "@auth/prisma-adapter"; export const { handlers, signIn, signOut, auth } = NextAuth({ adapter: PrismaAdapter(prisma), - providers: [GitHub, Gitea], + providers: [ + GitHub, + Gitea({ + enterprise: { + baseUrl: process.env.GITEA_BASE_URL, + }, + }), + ], });