Fix login
This commit is contained in:
parent
d6381f60c7
commit
1b3659b50e
6 changed files with 37 additions and 22 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import MatrixService from '../services/matrix.service';
|
||||
|
||||
const user = JSON.parse(localStorage.getItem('user'));
|
||||
const initialState = user
|
||||
? { status: { loggedIn: true }, user }
|
||||
|
|
@ -10,7 +8,7 @@ export const auth = {
|
|||
state: initialState,
|
||||
actions: {
|
||||
login({ commit }, user) {
|
||||
return MatrixService.login(user).then(
|
||||
return this._vm.$matrix.login(user).then(
|
||||
user => {
|
||||
commit('loginSuccess', user);
|
||||
return Promise.resolve(user);
|
||||
|
|
@ -22,7 +20,7 @@ export const auth = {
|
|||
);
|
||||
},
|
||||
logout({ commit }) {
|
||||
MatrixService.logout();
|
||||
this._vm.$matrix.logout();
|
||||
commit('logout');
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue