From faaed89a4f5d5db1a7b0c1eb540efc73dc3e1535 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 30 Jul 2024 03:28:38 +0100 Subject: [PATCH] fix: fix social auth --- next.config.mjs | 10 ++++++++++ src/actions/google.ts | 1 - .../_components/layout/navbar/index.tsx | 5 ++++- src/app/dashboard/(user-dashboard)/dashboard/page.tsx | 5 ----- src/app/dashboard/(user-dashboard)/page.tsx | 9 +++++++++ src/app/dashboard/authprovide.tsx | 10 ++++++++++ src/app/dashboard/layout.tsx | 9 +++++++++ src/auth.config.ts | 7 ------- 8 files changed, 42 insertions(+), 14 deletions(-) delete mode 100644 src/app/dashboard/(user-dashboard)/dashboard/page.tsx create mode 100644 src/app/dashboard/(user-dashboard)/page.tsx create mode 100644 src/app/dashboard/authprovide.tsx create mode 100644 src/app/dashboard/layout.tsx diff --git a/next.config.mjs b/next.config.mjs index 8c8bab67b..3d1ed5d33 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,6 +1,16 @@ /** @type {import('next').NextConfig} */ const nextConfig = { output: "standalone", + images: { + remotePatterns: [ + { + protocol: "https", + hostname: "lh3.googleusercontent.com", + }, + { hostname: "ui-avatars.com", protocol: "https" }, + { hostname: "res.cloudinary.com", protocol: "http" }, + ], + }, }; export default nextConfig; diff --git a/src/actions/google.ts b/src/actions/google.ts index 85a72549d..7849e2cdd 100644 --- a/src/actions/google.ts +++ b/src/actions/google.ts @@ -9,7 +9,6 @@ const GOOGLE_SIGN_IN = async (profile: any) => { try { // eslint-disable-next-line unicorn/prevent-abbreviations const res = await $http.post("/auth/google", profile); - return { user: res.data, }; diff --git a/src/app/dashboard/(user-dashboard)/_components/layout/navbar/index.tsx b/src/app/dashboard/(user-dashboard)/_components/layout/navbar/index.tsx index 693fca210..d32f109de 100644 --- a/src/app/dashboard/(user-dashboard)/_components/layout/navbar/index.tsx +++ b/src/app/dashboard/(user-dashboard)/_components/layout/navbar/index.tsx @@ -7,6 +7,7 @@ import { Menu, SearchIcon, } from "lucide-react"; +import { useSession } from "next-auth/react"; import Link from "next/link"; import { usePathname } from "next/navigation"; @@ -44,6 +45,7 @@ const navlinks = [ const UserNavbar = () => { const pathname = usePathname(); + const { data: session } = useSession(); const currentPath = pathname?.split("/")[2]; return (