feat(auth): add GitHub provider for authentication and update Next.js config for remote images

This commit is contained in:
ngc2207 2024-12-29 14:53:51 +08:00
parent 8f2fa3b564
commit 3b654bafe3
2 changed files with 12 additions and 2 deletions

View File

@ -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;

View File

@ -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],
});