From 66aca99a9465c9b3da3c9f32eacb4035bec67b1a Mon Sep 17 00:00:00 2001 From: seungju Date: Tue, 16 Apr 2024 19:03:59 +0900 Subject: [PATCH 1/4] Revert "." This reverts commit 120bfe019cc959558d0e0df4597c2c86023b1b81. --- modals/userRequest/StudyPresetModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modals/userRequest/StudyPresetModal.tsx b/modals/userRequest/StudyPresetModal.tsx index 8a58913e2..cba62bcc1 100644 --- a/modals/userRequest/StudyPresetModal.tsx +++ b/modals/userRequest/StudyPresetModal.tsx @@ -1,7 +1,7 @@ import { Box } from "@chakra-ui/react"; import dayjs from "dayjs"; -import { usePathname, useRouter, useSearchParams } from "next/navigation"; import { useSession } from "next-auth/react"; +import { usePathname, useRouter, useSearchParams } from "next/navigation"; import { useEffect, useState } from "react"; import { useQueryClient } from "react-query"; From e5dc1dd53335ebbe8456cf326391030847ce1870 Mon Sep 17 00:00:00 2001 From: seungju Date: Tue, 16 Apr 2024 19:08:27 +0900 Subject: [PATCH 2/4] fix: deleted api auth token --- pages/api/token/index.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pages/api/token/index.ts diff --git a/pages/api/token/index.ts b/pages/api/token/index.ts new file mode 100644 index 000000000..f68ad2e27 --- /dev/null +++ b/pages/api/token/index.ts @@ -0,0 +1,15 @@ +import { NextApiRequest, NextApiResponse } from "next"; +import { getToken } from "next-auth/jwt"; + +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + const { method } = req; + + const secret = process.env.NEXTAUTH_SECRET; + + switch (method) { + case "GET": + const jwt = await getToken({ req, secret, raw: true }); + res.status(200).json(jwt); + break; + } +} From 2e4c94b79ac728fb1fbc39d690d03e3d43020139 Mon Sep 17 00:00:00 2001 From: seungju Date: Tue, 16 Apr 2024 19:15:19 +0900 Subject: [PATCH 3/4] fix: eslint error --- modals/userRequest/StudyPresetModal.tsx | 2 +- pages/api/token/index.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modals/userRequest/StudyPresetModal.tsx b/modals/userRequest/StudyPresetModal.tsx index cba62bcc1..8a58913e2 100644 --- a/modals/userRequest/StudyPresetModal.tsx +++ b/modals/userRequest/StudyPresetModal.tsx @@ -1,7 +1,7 @@ import { Box } from "@chakra-ui/react"; import dayjs from "dayjs"; -import { useSession } from "next-auth/react"; import { usePathname, useRouter, useSearchParams } from "next/navigation"; +import { useSession } from "next-auth/react"; import { useEffect, useState } from "react"; import { useQueryClient } from "react-query"; diff --git a/pages/api/token/index.ts b/pages/api/token/index.ts index f68ad2e27..4a55b10fa 100644 --- a/pages/api/token/index.ts +++ b/pages/api/token/index.ts @@ -7,9 +7,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) const secret = process.env.NEXTAUTH_SECRET; switch (method) { - case "GET": + case "GET": { const jwt = await getToken({ req, secret, raw: true }); res.status(200).json(jwt); break; + } } } From 67a6a513c7f4fe523dca9200985081081c7c9006 Mon Sep 17 00:00:00 2001 From: seungju Date: Thu, 18 Apr 2024 09:29:09 +0900 Subject: [PATCH 4/4] chore: fix issue #91 --- components/molecules/ImageUploadInput.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/molecules/ImageUploadInput.tsx b/components/molecules/ImageUploadInput.tsx index 429edf2de..b2b18f93c 100644 --- a/components/molecules/ImageUploadInput.tsx +++ b/components/molecules/ImageUploadInput.tsx @@ -1,6 +1,7 @@ import { Input } from "@chakra-ui/react"; import { faCameraViewfinder } from "@fortawesome/pro-light-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { captureException } from "@sentry/nextjs"; import Image from "next/image"; import { useRef, useState } from "react"; import styled from "styled-components"; @@ -45,6 +46,7 @@ export default function ImageUploadInput({ setImageUrl: changeImage }: IImageUpl setImageUrl(image); changeImage(file); } else { + captureException(error); console.error("Error converting HEIC to JPEG", error); } }