From 8856fd43f368a8d0abc74235314ca58f920f559b Mon Sep 17 00:00:00 2001 From: yylyyl Date: Wed, 8 Nov 2023 14:53:42 -0500 Subject: [PATCH] login token is stored in localStorage now, instead of sessionStorage --- web/src/lib/dataModel.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/lib/dataModel.js b/web/src/lib/dataModel.js index 7b158cc..fea632f 100644 --- a/web/src/lib/dataModel.js +++ b/web/src/lib/dataModel.js @@ -5,7 +5,7 @@ import {receiveOnlyWebsocket} from "./wsHelper"; const prefix = '/api'; const sessionKeyName = 'containerup_key'; -let loginKey = sessionStorage.getItem(sessionKeyName); +let loginKey = localStorage.getItem(sessionKeyName); const errors = { errNoLogin: new Error('not logged in'), @@ -25,7 +25,7 @@ const login = (username, password) => { }) .then(resp => { loginKey = resp.data.key; - sessionStorage.setItem(sessionKeyName, loginKey); + localStorage.setItem(sessionKeyName, loginKey); }); }; @@ -36,7 +36,7 @@ const logout = () => { const key = loginKey; loginKey = ''; - sessionStorage.removeItem(sessionKeyName); + localStorage.removeItem(sessionKeyName); return axios.post(prefix + '/logout', { }, {