From 2121f86a3346ef0f96f8da3621267055828ac88d Mon Sep 17 00:00:00 2001 From: gourav Date: Sat, 15 Jun 2024 00:12:19 +0530 Subject: [PATCH] switched to session storage --- frontend/src/components/CreateSecret.vue | 2 +- frontend/src/components/HomePage.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/CreateSecret.vue b/frontend/src/components/CreateSecret.vue index a656343..53e8b08 100644 --- a/frontend/src/components/CreateSecret.vue +++ b/frontend/src/components/CreateSecret.vue @@ -46,7 +46,7 @@ export default { methods: { async createSecret() { const url = `${this.apiBaseUrl}/secret`; - const token = localStorage.getItem("token"); + const token = sessionStorage.getItem("token"); const requestOptions = { method: "POST", headers: { diff --git a/frontend/src/components/HomePage.vue b/frontend/src/components/HomePage.vue index d36741c..64fbe9f 100644 --- a/frontend/src/components/HomePage.vue +++ b/frontend/src/components/HomePage.vue @@ -49,7 +49,7 @@ export default { if ("message" in response) { if (response.message === "authenticated") { const token = response.accessToken; - localStorage.setItem("token", token); + sessionStorage.setItem("token", token); this.$emit("loggedin", true); } }