diff --git a/src/views/DebugView.vue b/src/views/DebugView.vue index 433478a..e69f66e 100644 --- a/src/views/DebugView.vue +++ b/src/views/DebugView.vue @@ -4,6 +4,7 @@ import type { VueCookies } from "vue-cookies"; import type { JSONWebToken } from "../@types/JSONWebToken"; import type { ChannelAutomationAPI } from "../@types/ChannelAutomationAPI"; import { DataTable } from "@jobinsjp/vue3-datatable"; +import { jwtDecode } from "jwt-decode"; import "@jobinsjp/vue3-datatable/dist/style.css"; import ErrorMessage from "../components/ErrorMessage.vue"; @@ -31,8 +32,11 @@ onMounted(() => { }); getChannnelAutomationAPI() - .then((result) => { - channelAutomationAPI.value = result; + .then((result: ChannelAutomationAPI | undefined) => { + if (result) { + channelAutomationAPI.value = result; + jwtDecoded.value = jwtDecode(result.authentication); + } }) .catch((error: Error) => { errorMessage.value = error.message;