|
@@ -1,4 +1,5 @@ |
|
|
import Password from '../api/password'; |
|
|
import Password from '../api/password'; |
|
|
|
|
|
import User from '../api/user'; |
|
|
|
|
|
|
|
|
import * as types from './mutation-types' |
|
|
import * as types from './mutation-types' |
|
|
|
|
|
|
|
@@ -6,6 +7,15 @@ export const loadPasswordFirstTime = ({commit}) => { |
|
|
commit(types.LOAD_PASSWORD_FIRST_TIME); |
|
|
commit(types.LOAD_PASSWORD_FIRST_TIME); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export const refreshToken = ({commit, state}) => { |
|
|
|
|
|
const token = state.token; |
|
|
|
|
|
if (token) { |
|
|
|
|
|
User.requestNewToken({token}, {baseURL: state.baseURL}) |
|
|
|
|
|
.then(newToken => commit(types.SET_TOKEN, {token: newToken})) |
|
|
|
|
|
.catch(() => commit(types.LOGOUT)); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
export const loadPasswordForSite = ({commit}, payload) => { |
|
|
export const loadPasswordForSite = ({commit}, payload) => { |
|
|
commit(types.LOAD_PASSWORD_FOR_SITE, payload); |
|
|
commit(types.LOAD_PASSWORD_FOR_SITE, payload); |
|
|
}; |
|
|
}; |
|
|