From ecc811c36d75acfe77e6e9856a2775127d303d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=8C=EC=9A=B8=EC=B9=98=ED=82=A8?= <90738604+soulchicken@users.noreply.github.com> Date: Wed, 25 Oct 2023 21:33:35 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=ED=95=9C=20?= =?UTF-8?q?=EC=9C=A0=EC=A0=80=EA=B0=80=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=99=94=EC=9D=84=20?= =?UTF-8?q?=EB=95=8C=20=ED=95=B8=EB=93=A4=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../socialLoginButton/GoogleButton.tsx | 2 +- .../account/socialLoginButton/KakaoButton.tsx | 2 +- .../account/socialLoginButton/NaverButton.tsx | 2 +- src/middleware.ts | 2 +- src/pages/index.tsx | 73 ++++++++++++------- src/pages/login/index.tsx | 2 +- 6 files changed, 51 insertions(+), 32 deletions(-) diff --git a/src/components/account/socialLoginButton/GoogleButton.tsx b/src/components/account/socialLoginButton/GoogleButton.tsx index b3f1748..f6bf59d 100644 --- a/src/components/account/socialLoginButton/GoogleButton.tsx +++ b/src/components/account/socialLoginButton/GoogleButton.tsx @@ -14,7 +14,7 @@ const GoogleButton = () => { const googleLoginHandler = () => { setToastMessage('소셜로그인은 추후에 제공될 예정입니다. :)'); // signIn('google', { - // callbackUrl: '/friends', + // callbackUrl: '/', // redirect: false, // }); }; diff --git a/src/components/account/socialLoginButton/KakaoButton.tsx b/src/components/account/socialLoginButton/KakaoButton.tsx index e0b0d88..89d7e42 100644 --- a/src/components/account/socialLoginButton/KakaoButton.tsx +++ b/src/components/account/socialLoginButton/KakaoButton.tsx @@ -14,7 +14,7 @@ const KakaoButton = () => { const kakaoLoginHandler = () => { setToastMessage('소셜로그인은 추후에 제공될 예정입니다. :)'); // signIn('kakao', { - // callbackUrl: '/friends', + // callbackUrl: '/', // redirect: false, // }); }; diff --git a/src/components/account/socialLoginButton/NaverButton.tsx b/src/components/account/socialLoginButton/NaverButton.tsx index 85b33f1..58a4141 100644 --- a/src/components/account/socialLoginButton/NaverButton.tsx +++ b/src/components/account/socialLoginButton/NaverButton.tsx @@ -14,7 +14,7 @@ const NaverButton = () => { const naverLoginHandler = () => { setToastMessage('소셜로그인은 추후에 제공될 예정입니다. :)'); // signIn('naver', { - // callbackUrl: '/friends', + // callbackUrl: '/', // redirect: false, // }); }; diff --git a/src/middleware.ts b/src/middleware.ts index 0f1015f..93a4332 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -39,7 +39,7 @@ const withOutAuth = async (req:NextRequest, token: boolean) => { const url = req.nextUrl.clone(); if (token) { - url.pathname = '/friends'; + url.pathname = '/'; return NextResponse.redirect(url); } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 4a1a207..584f9c0 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -3,34 +3,53 @@ import Link from 'next/link'; import Image from 'next/image'; import SEO from '@/components/common/head/SEO'; import Button from '@/components/common/button/Button'; +import { useSession } from 'next-auth/react'; -const Home = () => ( - <> - -
-
- 썸네일 -
-
- - - - - - -
-
- -); +const Home = () => { + console.log(); + const { data: session }: any = useSession(); + + return ( + <> + +
+
+ 썸네일 +
+ +
+ + ); +}; export default Home; diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index 1b9365a..c3ddd8c 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -23,7 +23,7 @@ const Login = () => { signIn('credentials', { email, password, - callbackUrl: '/friends', + callbackUrl: '/', }); }; return (