import UserService from "@/services/UserService"; // const localStorageToken = JSON.parse(localStorage.getItem("accessToken")) export const state = () => ({ accessToken: '', auth: false }); export const mutations = { SET_USER_TOKEN (state, token) { state.accessToken = token state.auth = true } }; export const actions = { login({ commit }, params) { return UserService.login(params).then((accesToken) => { }) }, registration({ commit }, params) { return UserService.registration(params) .then((response) => { localStorage.setItem('accessToken', response.toString()) commit("SET_USER_TOKEN", response) return response }) }, }; export const getters = { };