diff --git a/src/app/auth/validation/complete/page.tsx b/src/app/auth/validation/complete/page.tsx
index ffd44b65..72628b9c 100644
--- a/src/app/auth/validation/complete/page.tsx
+++ b/src/app/auth/validation/complete/page.tsx
@@ -4,17 +4,30 @@ import { useRouter, useSearchParams } from "next/navigation";
import LottieClient from "@shared/components/Lottie";
import { Button } from "@shared/components/ui/button";
+
import useIsLogin from "@shared/hooks/useIsLogin";
+
import { Mixpanel } from "@shared/utils/mixpanel";
import { SIGNUP_COMPLETED } from "@auth/constants/auth";
import lottieJson from "public/assets/Problem_Complete.json";
import FewLogo from "public/enterlogo.svg";
+
export default function ValidationCompletePage() {
const searchParams = useSearchParams();
const router = useRouter();
const memberEmail = searchParams.get("member_email");
+
const isLogin = useIsLogin();
+
+ // useAuth(auth_token ? auth_token : "");
+
+ // useEffect(function setMixpanel() {
+ // if (memberEmail) {
+ // console.log(memberEmail);
+ // }
+ // }, []);
+
return (
@@ -32,7 +45,6 @@ export default function ValidationCompletePage() {
Mixpanel.identify({ id: memberEmail });
Mixpanel.people.set({ peoples: { $email: memberEmail } });
}
-
router.push("/");
}}
>
diff --git a/src/app/workbook/[id]/page.tsx b/src/app/workbook/[id]/page.tsx
index 3f1830a3..14aec1db 100644
--- a/src/app/workbook/[id]/page.tsx
+++ b/src/app/workbook/[id]/page.tsx
@@ -47,11 +47,11 @@ export default function WorkbookPage() {
// usePathname 로 workbook id 받기
const pathname = usePathname();
const workbookId = getWorkbookId(pathname);
- useTrackMixpanel({
- eventKey: EVENT_NAME.WORKBOOK_APPEAR,
- property: { id: workbookId },
- dep: pathname,
- });
+ // useTrackMixpanel({
+ // eventKey: EVENT_NAME.WORKBOOK_APPEAR,
+ // property: { id: workbookId },
+ // dep: pathname,
+ // });
const { data: workbookInfo, isLoading } = useQuery({
...getWorkbookQueryOptions(workbookId),
diff --git a/src/article/components/ArticleBottomButton/indext.tsx b/src/article/components/ArticleBottomButton/indext.tsx
index 3c324bec..28dc3421 100644
--- a/src/article/components/ArticleBottomButton/indext.tsx
+++ b/src/article/components/ArticleBottomButton/indext.tsx
@@ -5,9 +5,7 @@ import { useParams, useRouter } from "next/navigation";
import { HTMLAttributes } from "react";
import { Button } from "@shared/components/ui/button";
-import { EVENT_NAME } from "@shared/constants/mixpanel";
import { useProblemIdsViewModel } from "@shared/models/useProblemIdsViewModel";
-import { Mixpanel } from "@shared/utils/mixpanel";
interface ArticleBottomButtonProps extends HTMLAttributes
{}
export default function ArticleBottomButton({
@@ -18,10 +16,10 @@ export default function ArticleBottomButton({
const { getCurrentProblemId } = useProblemIdsViewModel();
const onClickGoProblem = () => {
push(`/problem/${getCurrentProblemId()}`);
- Mixpanel.track({
- name: EVENT_NAME.ARTICLE_PROBLEMBUTTON_TAPPED,
- property: { id: articleId },
- });
+ // Mixpanel.track({
+ // name: EVENT_NAME.ARTICLE_PROBLEMBUTTON_TAPPED,
+ // property: { id: articleId },
+ // });
};
return (
;
diff --git a/src/auth/hooks/useLogout.tsx b/src/auth/hooks/useLogout.tsx
index 23fa8351..811eee93 100644
--- a/src/auth/hooks/useLogout.tsx
+++ b/src/auth/hooks/useLogout.tsx
@@ -9,7 +9,6 @@ import { deleteCookie } from "cookies-next";
import { ApiResponse } from "@api/fewFetch";
import { COOKIES } from "@shared/constants/token";
-import { Mixpanel } from "@shared/utils/mixpanel";
import { logOutMutaionOption } from "@auth/remotes/logoutMembersQueryOption";
@@ -23,7 +22,7 @@ export const useLogout = () => {
// 쿠키 삭제 및 로그인 페이지로 이동
deleteCookie(COOKIES.REFRESH_TOKEN);
deleteCookie(COOKIES.ACCESS_TOKEN);
- Mixpanel.reset();
+ // Mixpanel.reset();
router.push("/");
window.location.reload();
}
diff --git a/src/main/components/MainHeader/index.tsx b/src/main/components/MainHeader/index.tsx
index 84366e23..e8f4f047 100644
--- a/src/main/components/MainHeader/index.tsx
+++ b/src/main/components/MainHeader/index.tsx
@@ -8,7 +8,7 @@ import { cn } from "@shared/utils/cn";
import DropDownMenuWrapper from "../DropdownMenuWrapper";
import FewLogo from "public/assets/icon/fewlogo.svg";
export default function MainHeader() {
- useTrackMixpanel({ eventKey: EVENT_NAME.MAIN_APPEAR });
+ // useTrackMixpanel({ eventKey: EVENT_NAME.MAIN_APPEAR });
const [toggleMenu, setToggleMenu] = useState(false);
const handleToggleMenu = () => {
diff --git a/src/problem/components/ProblemTitle/index.tsx b/src/problem/components/ProblemTitle/index.tsx
index ecda1bee..4292b248 100644
--- a/src/problem/components/ProblemTitle/index.tsx
+++ b/src/problem/components/ProblemTitle/index.tsx
@@ -6,9 +6,6 @@ import { useMutationState, useQuery } from "@tanstack/react-query";
import { ApiResponse } from "@api/fewFetch";
-import { EVENT_NAME } from "@shared/constants/mixpanel";
-import useTrackMixpanel from "@shared/hooks/useTrackMixpanel";
-
import ProblemSkeleton from "../ProblemSkeleton";
import { PROBLEM_TITLE_INFO } from "@problem/constants/problemInfo";
import { QUERY_KEY } from "@problem/remotes/api";
@@ -30,11 +27,11 @@ export default function ProblemTitle() {
},
select: (mutation) => mutation.state.data as ApiResponse,
});
- useTrackMixpanel({
- eventKey: EVENT_NAME.PROBLEM_APPEAR,
- property: { id: problemId },
- dep: problemId,
- });
+ // useTrackMixpanel({
+ // eventKey: EVENT_NAME.PROBLEM_APPEAR,
+ // property: { id: problemId },
+ // dep: problemId,
+ // });
if (isLoading || isError || !problemInfo)
return ;
diff --git a/src/shared/middlewares/auth.ts b/src/shared/middlewares/auth.ts
index f15fb67a..93371e2e 100644
--- a/src/shared/middlewares/auth.ts
+++ b/src/shared/middlewares/auth.ts
@@ -15,44 +15,40 @@ type authMiddlewareProps = {
};
export const AuthMiddleware = async ({ req, nextUrl }: authMiddlewareProps) => {
- try {
- const { searchParams } = nextUrl;
- const auth_token = searchParams.get(AUTH_TOKEN);
- if (auth_token) {
- const response: ApiResponse = await fewFetch().post(
- API_ROUTE.TOKEN(auth_token),
- );
-
- const authData = response.data;
-
- if (authData?.message === "알 수 없는 오류가 발생했어요.") {
- nextUrl.searchParams.delete(AUTH_TOKEN);
- const response = NextResponse.redirect(nextUrl);
-
- // response.cookies.set(COOKIES.ACCESS_TOKEN, "false");
- response.cookies.set(ISLOGIN, "false");
-
- return NextResponse.redirect(nextUrl);
- }
- if (authData?.data?.accessToken) {
- const accessToken = authData.data.accessToken;
- const memberEmail = tokenParse(accessToken).memberEmail;
-
- nextUrl.searchParams.delete(AUTH_TOKEN);
- nextUrl.searchParams.set("member_email", memberEmail);
-
- const response = NextResponse.redirect(nextUrl);
-
- response.cookies.set(COOKIES.ACCESS_TOKEN, authData?.data?.accessToken);
- response.cookies.set(
- COOKIES.REFRESH_TOKEN,
- authData?.data?.refreshToken,
- );
-
- return response;
- }
+ const { searchParams } = nextUrl;
+ const auth_token = searchParams.get(AUTH_TOKEN);
+ if (auth_token) {
+ const response: ApiResponse = await fewFetch().post(
+ API_ROUTE.TOKEN(auth_token),
+ );
+
+ const authData = response.data;
+
+ if (authData?.message === "알 수 없는 오류가 발생했어요.") {
+ nextUrl.searchParams.delete(AUTH_TOKEN);
+ const response = NextResponse.redirect(nextUrl);
+
+ response.cookies.set(ISLOGIN, "false");
+
+ return NextResponse.redirect(nextUrl);
+ }
+ if (authData?.data?.accessToken) {
+ const accessToken = authData.data.accessToken;
+ const memberEmail = tokenParse(accessToken).memberEmail;
+
+ nextUrl.searchParams.delete(AUTH_TOKEN);
+ nextUrl.searchParams.set("member_email", memberEmail);
+
+ const response = NextResponse.redirect(nextUrl);
+
+ response.cookies.set(COOKIES.ACCESS_TOKEN, authData?.data?.accessToken, {
+ maxAge: 24 * 60 * 60, // 30 days
+ });
+ response.cookies.set(COOKIES.REFRESH_TOKEN, authData?.data?.refreshToken, {
+ maxAge: 24 * 60 * 60, // 30 days
+ });
+
+ return response;
}
- } catch {
- return undefined;
}
};