From 3b654bafe3dcf64c47891180f81ffb9c8dade162 Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Sun, 29 Dec 2024 14:53:51 +0800 Subject: [PATCH] feat(auth): add GitHub provider for authentication and update Next.js config for remote images --- next.config.ts | 11 ++++++++++- src/auth.ts | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/next.config.ts b/next.config.ts index cb651cd..58745f9 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,5 +1,14 @@ import type { NextConfig } from "next"; -const nextConfig: NextConfig = {}; +const nextConfig: NextConfig = { + images: { + remotePatterns: [ + { + protocol: "https", + hostname: "avatars.githubusercontent.com", + }, + ], + }, +}; export default nextConfig; diff --git a/src/auth.ts b/src/auth.ts index 580d157..3fb5ddc 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -1,8 +1,9 @@ import NextAuth from "next-auth"; import { prisma } from "@/lib/prisma"; +import GitHub from "next-auth/providers/github"; import { PrismaAdapter } from "@auth/prisma-adapter"; export const { handlers, signIn, signOut, auth } = NextAuth({ adapter: PrismaAdapter(prisma), - providers: [], + providers: [GitHub], });