Skip to content

Instantly share code, notes, and snippets.

@xanf

xanf/logout.js Secret

Created January 6, 2017 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xanf/23d5e43dfe95cf23d12af0213bb35cd5 to your computer and use it in GitHub Desktop.
Save xanf/23d5e43dfe95cf23d12af0213bb35cd5 to your computer and use it in GitHub Desktop.
/* @flow */
import { LOGOUT } from 'src/store/modules/auth/auth-mutations';
import { mapMutations } from 'vuex';
import router from 'src/router';
const { logout } = mapMutations({
logout: LOGOUT,
});
export default {
methods: {
handleLogout() {
logout.call(this);
router.push('/login');
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment