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); } } diff --git a/pages/api/token/index.ts b/pages/api/token/index.ts new file mode 100644 index 000000000..4a55b10fa --- /dev/null +++ b/pages/api/token/index.ts @@ -0,0 +1,16 @@ +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; + } + } +}