<NME> auth.js
<BEF> import Cookies from 'js-cookie'
import Vue from 'vue'

import repository from '@/api/repository'
import account from '@/api/account'

}

function fetchUser (commit) {
  return Vue.prototype.$axios.get('/accounts/me').then(resp => {
    commit('SET_AUTH_USER', { authUser: resp.data, isAuthenticated: true })
  })
}
  isAuthenticated: false
})

const getters = {
  isAuthenticated: state => state.isAuthenticated,
  authUser: state => state.authUser
}

const mutations = {
  SET_AUTH_USER (state, { authUser, isAuthenticated }) {
    state.authUser = authUser
    state.isAuthenticated = isAuthenticated
    Vue.config.language = authUser.language
  },
  LOGOUT_USER (state) {
    state.authUser = null
    state.isAuthenticated = false
  }
}

const actions = {
  fetchUser ({ commit }) {
    return account.getMe().then(resp => {
      commit('SET_AUTH_USER', { authUser: resp.data, isAuthenticated: true })
    })
  },
  initialize ({ commit, dispatch, state }) {
    const token = Cookies.get('token')
    if (!token) {
      return
    }
    setupAxios(token)
    return dispatch('fetchUser')
  },
  logout ({ commit }) {
    return new Promise((resolve, reject) => {
      delete repository.defaults.headers.common.Authorization
      Cookies.remove('token')
      Cookies.remove('refreshToken')
      commit('LOGOUT_USER')
      resolve()
    })
  }
}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}

<MSG> API refactoring and new domain form fields.

<DFF> @@ -7,7 +7,7 @@ function setupAxios (token) {
 }
 
 function fetchUser (commit) {
-  return Vue.prototype.$axios.get('/accounts/me').then(resp => {
+  return Vue.prototype.$axios.get('/account/me').then(resp => {
     commit('SET_AUTH_USER', { authUser: resp.data, isAuthenticated: true })
   })
 }

API refactoring and new domain form fields.