From 06fabece517b54006505693d18cfd5b82b30eb57 Mon Sep 17 00:00:00 2001 From: Tushar98644 Date: Tue, 11 Jul 2023 16:24:07 +0530 Subject: [PATCH] role based authentication --- src/components/Navbar/Navbar.tsx | 21 +++++++++++++++++---- src/pages/api/auth/[...nextauth].ts | 6 ++++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/components/Navbar/Navbar.tsx b/src/components/Navbar/Navbar.tsx index f223cb0..9a0eca3 100644 --- a/src/components/Navbar/Navbar.tsx +++ b/src/components/Navbar/Navbar.tsx @@ -56,10 +56,23 @@ const Navbar = () => { <> diff --git a/src/pages/api/auth/[...nextauth].ts b/src/pages/api/auth/[...nextauth].ts index 159a1fd..4aee096 100644 --- a/src/pages/api/auth/[...nextauth].ts +++ b/src/pages/api/auth/[...nextauth].ts @@ -11,12 +11,14 @@ export const authOptions = { clientSecret: process.env.GITHUB_SECRET as string, }), GoogleProvider({ - clientId: process.env.GOOGLE_ID as string, - clientSecret: process.env.GOOGLE_SECRET as string, + clientId: process.env.GOOGLE_ID as string, + clientSecret: process.env.GOOGLE_SECRET as string, }), + ], secret: process.env.SECRET, adapter: MongoDBAdapter(clientPromise), } + export default NextAuth(authOptions) \ No newline at end of file