diff --git a/html/export.html b/html/export.html index 0f7821d..9e3dc00 100644 --- a/html/export.html +++ b/html/export.html @@ -24,7 +24,7 @@ Import & Export - + Sign out @@ -47,7 +47,7 @@
diff --git a/html/passwords.html b/html/passwords.html index a3f6ac3..5a11408 100644 --- a/html/passwords.html +++ b/html/passwords.html @@ -25,7 +25,7 @@ Import & Export - + Sign out @@ -56,7 +56,7 @@ diff --git a/js/default-functions.js b/js/default-functions.js index 575c272..b77dee5 100644 --- a/js/default-functions.js +++ b/js/default-functions.js @@ -106,4 +106,11 @@ function getDate(date) { let local = new Date(date); local.setMinutes(date.getMinutes() - date.getTimezoneOffset()); return local.toJSON().slice(0, 10); +} + +function logout(){ + sessionStorage.url = null; + sessionStorage.username = null; + sessionStorage.password = null; + window.location.href = 'login.html'; } \ No newline at end of file diff --git a/js/export.js b/js/export.js index cf5aa16..96b9cac 100644 --- a/js/export.js +++ b/js/export.js @@ -1,3 +1,7 @@ +if(sessionStorage.url == null && typeof(sessionStorage.url) == 'undefined') window.location.href = 'login.html'; +if(sessionStorage.username == null && typeof(sessionStorage.username) == 'undefined') window.location.href = 'login.html'; +if(sessionStorage.password == null && typeof(sessionStorage.password) == 'undefined') window.location.href = 'login.html'; + function backup_passky(){ if(sessionStorage.passwords == null || typeof(sessionStorage.passwords) == 'undefined'){ diff --git a/js/prepasswords.js b/js/prepasswords.js index 072a256..140bd05 100644 --- a/js/prepasswords.js +++ b/js/prepasswords.js @@ -1,3 +1,7 @@ +if(sessionStorage.url == null && typeof(sessionStorage.url) == 'undefined') window.location.href = 'login.html'; +if(sessionStorage.username == null && typeof(sessionStorage.username) == 'undefined') window.location.href = 'login.html'; +if(sessionStorage.password == null && typeof(sessionStorage.password) == 'undefined') window.location.href = 'login.html'; + function displayPassword(id, website, username, password){ const decrypted_password = CryptoJS.AES.decrypt(password, sessionStorage.password).toString(CryptoJS.enc.Utf8); const data = id + " " + website + " " + username + " " + decrypted_password;