Compare commits

..

2 Commits

Author SHA1 Message Date
b337873ca2 Merge branch 'dev' of git.odit.services:lfk/frontend into dev
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-19 18:49:12 +01:00
896fff04aa Fixed non-automatic logout
closes #38
2021-02-19 18:49:07 +01:00
2 changed files with 7 additions and 1 deletions

View File

@ -27,6 +27,12 @@
storeName: "lfk_admin",
description: "LfK! admin dashbaord",
});
window.onunhandledrejection = event => {
if(event.reason.toString() == "Error: Unauthorized"){
console.log("Found 1")
localForage.clear();
location.replace("/");
}};
//
import Login from "./components/auth/Login.svelte";
import Dashboard from "./components/dashboard/Dashboard.svelte";

View File

@ -28,7 +28,7 @@ const store = () => {
const jwtinfo = JSON.parse(atob(auth.access_token.split('.')[1]));
state.jwtinfo = jwtinfo;
localForage.setItem('logindata', auth);
});
}).catch(this.logout());
},
login(auth, jwtinfo) {
update((state) => {