diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts new file mode 100644 index 0000000..370cf94 --- /dev/null +++ b/app/api/auth/[...nextauth]/route.ts @@ -0,0 +1,2 @@ +import { handlers } from "@/app/auth" // Referring to the auth.ts we just created +export const { GET, POST } = handlers \ No newline at end of file diff --git a/app/auth.ts b/app/auth.ts new file mode 100644 index 0000000..2ff2c1a --- /dev/null +++ b/app/auth.ts @@ -0,0 +1,7 @@ + +import NextAuth from "next-auth" +import GitHub from "next-auth/providers/github" + +export const { handlers, signIn, signOut, auth } = NextAuth({ + providers: [GitHub], +}) \ No newline at end of file diff --git a/app/middleware.ts b/app/middleware.ts new file mode 100644 index 0000000..362bd8b --- /dev/null +++ b/app/middleware.ts @@ -0,0 +1 @@ +export { auth as middleware } from "@/app/auth" \ No newline at end of file diff --git a/app/page.tsx b/app/page.tsx index a03fe3c..66eebb2 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -5,6 +5,9 @@ import Link from 'next/link'; // import VulnerabilityList from '@/components/CveList'; import { message } from 'antd'; import Image from 'next/image'; +import SignIn from '@/components/sign-in'; +import { SessionProvider } from "next-auth/react" + const HomePage: React.FC = () => { const [searchQuery, setSearchQuery] = useState(''); @@ -49,13 +52,15 @@ const HomePage: React.FC = () => { -