From acc7f0a586c64500c5f720e70cdbccf9bffe76d9 Mon Sep 17 00:00:00 2001
From: bastantoine <bastien.antoine69+github@gmail.com>
Date: Tue, 27 Dec 2022 09:38:35 +0100
Subject: feat(new-tool): jwt parser (#262)

* npm install jwt-decode

* added base tool structure

* added function to decode JWT and display header and payload

* use a table to display the data

* show human readable values

* added switch to toggle display of parsed values

* lint

* replaced basic package-lock.json with pnpm-lock.json

* change the icon of the tool

* simplify return

* use camelCase

* added description of the tool

* always parse the values

* use camelCase...
---
 src/tools/jwt-parser/value.vue | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 src/tools/jwt-parser/value.vue

(limited to 'src/tools/jwt-parser/value.vue')

diff --git a/src/tools/jwt-parser/value.vue b/src/tools/jwt-parser/value.vue
new file mode 100644
index 0000000..82c1042
--- /dev/null
+++ b/src/tools/jwt-parser/value.vue
@@ -0,0 +1,24 @@
+<template>
+  <n-space>
+    {{ value.value }}
+    <em v-if="value.extension">({{ value.extension }})</em>
+  </n-space>
+</template>
+
+<script setup lang="ts">
+import { computed } from 'vue';
+import { parseClaimValue } from './jwt-parser.service';
+
+const props = defineProps({
+  claim: {
+    type: String,
+    default: '',
+  },
+  value: {
+    type: String,
+    default: '',
+  },
+});
+
+const value = computed(() => parseClaimValue(props.claim, props.value));
+</script>
-- 
cgit v1.2.3

