From 7e7e9790cc6f8a174c770a0b55f8c68abf7a3ae4 Mon Sep 17 00:00:00 2001 From: yeyounging <133792082+yeyounging@users.noreply.github.com> Date: Thu, 28 Nov 2024 23:09:17 +0900 Subject: [PATCH] HOTFIX --- src/app/auth/callback/page.tsx | 1 + src/app/home/components/TimeCard.tsx | 2 +- src/app/page.tsx | 1 - src/app/start/api/api.ts | 2 ++ src/app/start/components/Step3.tsx | 2 +- src/app/start/components/Step4.tsx | 4 ---- src/app/start/page.tsx | 2 +- src/middleware.ts | 31 ++++++++++++++++++++++++++++ 8 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 src/middleware.ts diff --git a/src/app/auth/callback/page.tsx b/src/app/auth/callback/page.tsx index fb5137c..1cf36de 100644 --- a/src/app/auth/callback/page.tsx +++ b/src/app/auth/callback/page.tsx @@ -43,6 +43,7 @@ function LoginCheck() { const data = await res.json() Cookies.set('accessToken', data.data.accessToken) + Cookies.set('role', data.data.userInfo.role) setUserInfo({ ...data.data.userInfo, profileImage: diff --git a/src/app/home/components/TimeCard.tsx b/src/app/home/components/TimeCard.tsx index 2cbbcc8..1750037 100644 --- a/src/app/home/components/TimeCard.tsx +++ b/src/app/home/components/TimeCard.tsx @@ -1,5 +1,5 @@ import { categoryLabels } from '@/app/archive/api/types' -import { Badge, Cup, Div } from '@/components' +import { Badge, Div } from '@/components' import Image from 'next/image' interface TimeCardProps { diff --git a/src/app/page.tsx b/src/app/page.tsx index 589e28d..69cb02e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -12,7 +12,6 @@ export default function Home() { const [logoColor, setlogoColor] = useState('white') useEffect(() => { - const timer = setTimeout(() => { setIsSplash(false) }, 1200) diff --git a/src/app/start/api/api.ts b/src/app/start/api/api.ts index f4950ed..07e6c9a 100644 --- a/src/app/start/api/api.ts +++ b/src/app/start/api/api.ts @@ -1,3 +1,4 @@ +import Cookies from 'js-cookie' import { http } from '@/api' import useUserInfo, { UserInfo } from '@/store/useUserInfo' import { useMutation, useSuspenseQuery } from '@tanstack/react-query' @@ -24,6 +25,7 @@ export const usePostOnboard = () => { onSuccess: ({ data }) => { const updatedUserInfo = { ...data, role: 'MEMBER' as const } setUserInfo(updatedUserInfo) + Cookies.set('role', 'MEMBER') router.push('/home') }, onError: (error) => { diff --git a/src/app/start/components/Step3.tsx b/src/app/start/components/Step3.tsx index fb59140..4a739c5 100644 --- a/src/app/start/components/Step3.tsx +++ b/src/app/start/components/Step3.tsx @@ -8,7 +8,7 @@ export default function Step3() { useProfileSelector() return ( -
+

어떤 프로필로 함께 하시겠어요?

프로필은 나중에 바꿀 수 있어요 diff --git a/src/app/start/components/Step4.tsx b/src/app/start/components/Step4.tsx index 2c52326..64e219b 100644 --- a/src/app/start/components/Step4.tsx +++ b/src/app/start/components/Step4.tsx @@ -6,10 +6,6 @@ import Image from 'next/image' export default function Step4() { const { userInfo } = useUserInfo() - if (!userInfo.nickname) { - return
loading...
- } - return (
diff --git a/src/app/start/page.tsx b/src/app/start/page.tsx index 2d2d170..f54bfe7 100644 --- a/src/app/start/page.tsx +++ b/src/app/start/page.tsx @@ -73,7 +73,7 @@ export default function Start() {
-
+