switched to session storage

This commit is contained in:
Gourav Kumar 2024-06-15 00:12:19 +05:30
parent 1377d63347
commit 2121f86a33
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ export default {
methods: { methods: {
async createSecret() { async createSecret() {
const url = `${this.apiBaseUrl}/secret`; const url = `${this.apiBaseUrl}/secret`;
const token = localStorage.getItem("token"); const token = sessionStorage.getItem("token");
const requestOptions = { const requestOptions = {
method: "POST", method: "POST",
headers: { headers: {

View File

@ -49,7 +49,7 @@ export default {
if ("message" in response) { if ("message" in response) {
if (response.message === "authenticated") { if (response.message === "authenticated") {
const token = response.accessToken; const token = response.accessToken;
localStorage.setItem("token", token); sessionStorage.setItem("token", token);
this.$emit("loggedin", true); this.$emit("loggedin", true);
} }
} }