import { setDefaultToken } from '@/store/utils/api'
import { API_TOKEN, API_TOKEN_KEY } from '@/store/utils/localStorageKeys'

export default {
  inAppArea: async function(app) {
    setDefaultToken(app.$route.query.token)
  },
  outAppArea: function(app) {
    let token = localStorage.getItem(API_TOKEN)
    localStorage.setItem(API_TOKEN_KEY, API_TOKEN)

    setDefaultToken(token)
  },
}
