Closed robinscholz closed 3 years ago
When installing this module axios requests subsequent to the login get sent with the wrong credentials. Instead of using credentials stored within an .env file, the requests get sent with the credentials that where used for the basic-auth dialogue.
.env
const auth = { username: process.env.kirbyEmail, password: process.env.kirbyAuth } async getPages({ commit }, locale) { try { const pages = await this.$axios.$get(baseURL + '/rest/site/children', { auth, headers: { 'x-language': locale }, params: { select: 'content, id, children, status, template' } }) return commit('setPages', pages) } catch (error) { console.error(error) } } async nuxtServerInit({ dispatch, state }) { const locale = state.i18n.locale await dispatch('getPages', locale) }
Any idea how this could be fixed?
@robinscholz Thank you for your report. Can you provide the minimum URL of Codesandbox that can reproduce the phenomenon?
When installing this module axios requests subsequent to the login get sent with the wrong credentials. Instead of using credentials stored within an
.env
file, the requests get sent with the credentials that where used for the basic-auth dialogue.Any idea how this could be fixed?