💾 save new auth data to localstorage
ref#29
This commit is contained in:
parent
d92c6c0de9
commit
2cbb431acc
@ -1,5 +1,6 @@
|
|||||||
import { writable } from 'svelte/store';
|
import { writable } from 'svelte/store';
|
||||||
import { OpenAPI, AuthService } from '@odit/lfk-client-js';
|
import { OpenAPI, AuthService } from '@odit/lfk-client-js';
|
||||||
|
import localForage from "localforage";
|
||||||
|
|
||||||
export let users = writable([]);
|
export let users = writable([]);
|
||||||
export let tracks = writable([]);
|
export let tracks = writable([]);
|
||||||
@ -27,7 +28,7 @@ const store = () => {
|
|||||||
console.log('got new auth');
|
console.log('got new auth');
|
||||||
console.log(auth);
|
console.log(auth);
|
||||||
OpenAPI.TOKEN = auth.access_token;
|
OpenAPI.TOKEN = auth.access_token;
|
||||||
// TODO: update localstorage
|
localForage.setItem('logindata', auth);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
login(auth, jwtinfo) {
|
login(auth, jwtinfo) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user