From bbe70215e1687e0d84eac18e93799685894e7e97 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 30 Jul 2024 01:49:38 +0100 Subject: [PATCH] fix: fix social auth --- .../(landing-routes)/blog/[id]/BlogDetailsPage.tsx | 3 +++ src/app/(landing-routes)/blog/comments/page.tsx | 8 +++++++- src/lib/auth.react.ts | 13 ------------- src/lib/auth.ts | 7 ------- 4 files changed, 10 insertions(+), 21 deletions(-) delete mode 100644 src/lib/auth.react.ts delete mode 100644 src/lib/auth.ts diff --git a/src/app/(landing-routes)/blog/[id]/BlogDetailsPage.tsx b/src/app/(landing-routes)/blog/[id]/BlogDetailsPage.tsx index 570b6bae0..36bd41b75 100644 --- a/src/app/(landing-routes)/blog/[id]/BlogDetailsPage.tsx +++ b/src/app/(landing-routes)/blog/[id]/BlogDetailsPage.tsx @@ -28,6 +28,9 @@ const mockSession: Session = { user: { name: "Current User", email: "user@example.com", + id: "Strinf", + image: "Strinf", + access_token: "access_token", }, expires: "2100-01-01T00:00:00.000Z", }; diff --git a/src/app/(landing-routes)/blog/comments/page.tsx b/src/app/(landing-routes)/blog/comments/page.tsx index 7348e7882..913ebf921 100644 --- a/src/app/(landing-routes)/blog/comments/page.tsx +++ b/src/app/(landing-routes)/blog/comments/page.tsx @@ -6,7 +6,13 @@ import { sampleComments } from "~/components/common/comment-component/sample-com const CommentPage = () => { const mockSession: Session = { expires: "1", - user: { email: "a", name: "Adeyinka Akinsanya", image: "c" }, + user: { + name: "Current User", + email: "user@example.com", + id: "Strinf", + image: "Strinf", + access_token: "access_token", + }, }; return (
diff --git a/src/lib/auth.react.ts b/src/lib/auth.react.ts deleted file mode 100644 index b3d3d63c1..000000000 --- a/src/lib/auth.react.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { DefaultSession } from "next-auth"; -import { getSession as getAuthSession } from "next-auth/react"; - -export { signIn, signOut } from "next-auth/react"; - -interface Session extends DefaultSession { - user?: DefaultSession["user"] & { - id: string; - }; -} - -// @ts-expect-error Hacking the type so we don't have to do the module augmentation technique. -export const getSession: () => Promise = getAuthSession; diff --git a/src/lib/auth.ts b/src/lib/auth.ts deleted file mode 100644 index c1444a4a2..000000000 --- a/src/lib/auth.ts +++ /dev/null @@ -1,7 +0,0 @@ -import NextAuth from "next-auth"; - -const authOptions = NextAuth({ - providers: [], -}); - -export const { handlers, signIn, signOut, auth } = authOptions;