mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
isLoggedIn getter
This commit is contained in:
parent
b64d8969b5
commit
c893c65a31
@ -5,7 +5,6 @@ import router from '../routes/router.js'
|
|||||||
import loginAPI from '../apis/loginAPI'
|
import loginAPI from '../apis/loginAPI'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
// TODO make persistent: https://translate.google.de/translate?hl=de&sl=en&u=https://sandulat.com/safely-persisting-vuex-store-in-local-storage/&prev=search&pto=aue
|
|
||||||
export const store = new Vuex.Store({
|
export const store = new Vuex.Store({
|
||||||
state: {
|
state: {
|
||||||
session_id: null,
|
session_id: null,
|
||||||
@ -26,9 +25,9 @@ export const store = new Vuex.Store({
|
|||||||
},
|
},
|
||||||
// Retrieve a state variable
|
// Retrieve a state variable
|
||||||
getters: {
|
getters: {
|
||||||
/*isActive: (state, getters) => {
|
isLoggedIn: (state /*, getters */) => {
|
||||||
return state.active;
|
return state.session_id !== null;
|
||||||
}*/
|
}
|
||||||
},
|
},
|
||||||
// Syncronous mutation of the state
|
// Syncronous mutation of the state
|
||||||
mutations: {
|
mutations: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user