@@ -3,6 +3,7 @@ import { writable } from 'svelte/store';
|
||||
const store = () => {
|
||||
const state = {
|
||||
access_token: undefined,
|
||||
jwtinfo: undefined,
|
||||
isLoggedIn: false
|
||||
};
|
||||
|
||||
@@ -16,10 +17,10 @@ const store = () => {
|
||||
return state;
|
||||
});
|
||||
},
|
||||
|
||||
login(access_token) {
|
||||
login(access_token, jwtinfo) {
|
||||
update((state) => {
|
||||
state.access_token = access_token;
|
||||
state.jwtinfo = jwtinfo;
|
||||
state.isLoggedIn = true;
|
||||
console.log('login performed');
|
||||
return state;
|
||||
@@ -37,6 +38,7 @@ const store = () => {
|
||||
subscribe,
|
||||
set,
|
||||
update,
|
||||
state,
|
||||
...methods
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user