
function setToken (state, token) {
  state.token = token;
  if (token) {
    localStorage?.setItem("jwt", token);
  } else {
    localStorage?.removeItem("jwt");
  }
}

function setUser (state, user) {
  state.user = user;
}

function setPreferences (state, preferences) {
  state.preferences = preferences;
}

export default { setToken, setUser, setPreferences };
