untymage
6 months ago
880
1
Vue

Question about local storage mainpulation by client

Posted 6 months ago by untymage

I'm using vuex with laravel airlock

state: {
        user: localStorage.getItem('userInfo') || null;

	// userInfo is {"id:" 1, "username:" "alex"} etc...
    },

getters: {

	isLoggedIn(state){
		return !! state.user
	}

}

What happen if the user manipulate the local storage keys and set the fake information? because my getter isLoggedIn decides if the local storage have json string mean the user logged in and the other hand client can set the fake json string how do i find the json is from my side ?

Please sign in or create an account to participate in this conversation.