knowyt/client/src/plugins/engine/fetchUserInfo.js

14 lines
282 B
JavaScript
Raw Normal View History

export default async function() {
2021-08-12 22:41:23 +00:00
const { store } = this.context
try {
2021-08-12 22:41:23 +00:00
const response = await this.callApi('/api/userinfo')
store.commit('engine/setUser', response.data)
} catch(e) {
store.commit('engine/setUser', undefined)
return false
}
return true
}