@bjrmatos We are using vue-resource in the background, though below is the function I use in the store for authentication.
async fetchCookie ({ commit }) {
commit('startLoading', {})
try {
const formData = new FormData()
formData.append('username', 'report')
formData.append('password', 'report')
const res = await VueInstance.$jsReport.cookie(formData)
window.open(res.url.slice(0, res.url.lastIndexOf('/')))
} catch (err) {
VueInstance.$handleHttpError(err, false)
} finally {
commit('stopLoading', {})
}
}
Following the used part of the vue-resource code:
Vue.prototype.$jsReport = Vue.resource(`${host}/jsreport`, options, {
assets: {
method: 'GET',
url: `${host}/jsreport/odata/assets`
},
cookie: {
method: 'POST',
url: `${host}/jsreport/login?returnUrl=%2Fjsreport`
},
data: ...
})
Your example is working flawlessly if I just use it as-is in a new html file and go from there, though it is not really usable in exactly that way for us since we want to explicilty avoid to prompt the user for a username and password and are using vuetify, vue-resource and vuex in the project.