diff --git a/package.json b/package.json index f58edce..63efb37 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "dayjs": "^1.11.7", "framer-motion": "^7.6.19", "interweave": "^13.0.0", + "jose": "^4.11.1", "next": "13.0.2", "next-pwa": "^5.6.0", "next-seo": "^5.15.0", diff --git a/src/components/Navigation/Sidebar.tsx b/src/components/Navigation/Sidebar.tsx index 7b0b57f..af37b50 100644 --- a/src/components/Navigation/Sidebar.tsx +++ b/src/components/Navigation/Sidebar.tsx @@ -3,6 +3,7 @@ import { AnimatePresence, motion } from "framer-motion" import { useSidebarStore } from "../../state" import { HiMoon, HiSun, HiHome, HiEnvelope, HiMagnifyingGlass, HiChevronLeft, HiChevronRight } from 'react-icons/hi2'; import { BsFileTextFill } from "react-icons/bs" +import { SiJsonwebtokens } from "react-icons/si" import { themeChange } from "theme-change"; import Link from "next/link"; import { useRouter } from "next/router"; @@ -37,6 +38,11 @@ const Sidebar:FC = () => { path: "/generators/random-string", icon: , label: "Random String" + }, + { + path: "/others/jwt-debugger", + icon: , + label: "JWT Debugger" } ] diff --git a/src/pages/others/jwt-debugger.tsx b/src/pages/others/jwt-debugger.tsx new file mode 100644 index 0000000..afa4828 --- /dev/null +++ b/src/pages/others/jwt-debugger.tsx @@ -0,0 +1,26 @@ +import { type NextPage } from "next" +import { useRouter } from "next/router"; +import { Fragment } from "react"; +import { NextSeo } from "next-seo"; +import tools from "../../utils/tools"; + +const JWTDebugger:NextPage = () => { + const router = useRouter() + const tool = tools.find(tool => tool.id === router.pathname.split("/")[2]) + + return ( + + +
+
+

JWT Debugger

+
+
+
+ ) +} + +export default JWTDebugger \ No newline at end of file diff --git a/src/utils/tools.ts b/src/utils/tools.ts index 44bc903..5657dae 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -13,6 +13,13 @@ const tools = [ link: "random-string", id: "random-string", }, + { + name: "JWT Debugger", + description: "Decode, verify and generate JWT tokens.", + category: "others", + link: "jwt-debugger", + id: "jwt-debugger", + } ] export default tools \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 77105c5..4d2746f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3160,6 +3160,11 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" +jose@^4.11.1: + version "4.11.1" + resolved "https://registry.yarnpkg.com/jose/-/jose-4.11.1.tgz#8f7443549befe5bddcf4bae664a9cbc1a62da4fa" + integrity sha512-YRv4Tk/Wlug8qicwqFNFVEZSdbROCHRAC6qu/i0dyNKr5JQdoa2pIGoS04lLO/jXQX7Z9omoNewYIVIxqZBd9Q== + js-sdsl@^4.1.4: version "4.2.0" resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.2.0.tgz#278e98b7bea589b8baaf048c20aeb19eb7ad09d0"