How to use the vuex-pathify.commit function in vuex-pathify

To help you get started, we’ve selected a few vuex-pathify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NarHakobyan / awesome-vue-boilerplate / src / store / modules / auth.state.js View on Github external
logout() {
        commit('authState/SET_TOKEN', null);
        commit('authState/SET_USER', null);
    },
};
github NarHakobyan / awesome-vue-boilerplate / src / store / modules / auth.state.js View on Github external
login: withLoading('authState/login', async (_, credentials) => {
        const res = await Auth.login(credentials);
        commit('authState/SET_TOKEN', res.body.token.access);
        commit('authState/SET_USER', res.body.user);
        return res;
    }),
    activate(_, token) {
github NarHakobyan / awesome-vue-boilerplate / src / store / modules / auth.state.js View on Github external
login: withLoading('authState/login', async (_, credentials) => {
        const res = await Auth.login(credentials);
        commit('authState/SET_TOKEN', res.body.token.access);
        commit('authState/SET_USER', res.body.user);
        return res;
    }),
    activate(_, token) {
github NarHakobyan / awesome-vue-boilerplate / src / store / modules / auth.state.js View on Github external
async fetchCurrentUser({ getters }) {
        const { token } = getters;
        if (!token) {
            return false;
        }
        const res = await Auth.me();

        const user = res.body.user;
        commit('authState/SET_USER', user);

        return user;
    },
    logout() {
github NarHakobyan / awesome-vue-boilerplate / src / store / modules / auth.state.js View on Github external
logout() {
        commit('authState/SET_TOKEN', null);
        commit('authState/SET_USER', null);
    },
};