💾 save new auth data to localstorage

ref#29
This commit is contained in:
Philipp Dormann 2021-01-10 13:06:01 +01:00
parent d92c6c0de9
commit 2cbb431acc

View File

@ -1,5 +1,6 @@
import { writable } from 'svelte/store';
import { OpenAPI, AuthService } from '@odit/lfk-client-js';
import localForage from "localforage";
export let users = writable([]);
export let tracks = writable([]);
@ -27,7 +28,7 @@ const store = () => {
console.log('got new auth');
console.log(auth);
OpenAPI.TOKEN = auth.access_token;
// TODO: update localstorage
localForage.setItem('logindata', auth);
});
},
login(auth, jwtinfo) {