Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logout() {
commit('authState/SET_TOKEN', null);
commit('authState/SET_USER', null);
},
};
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) {
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) {
set (value) {
commit('basics/SET_FOO', value)
}
},
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() {
logout() {
commit('authState/SET_TOKEN', null);
commit('authState/SET_USER', null);
},
};