Hi agian,
When the user logs in auth module sets the headers in axios with the authentication header which is cool but when the user logs out, the reset() method does not empty/reset the header, so unless the page is refreshed the user is still logged in when making api requests
So adding something like
this.$axios.setHeader('Authorization', null) to reset() should do it
for those who have the same issue you can add:
this.$axios.setHeader('Authorization', null) to whatever log out method you are using manually until this is implemented.
i'd love to contribute with a PR but this is such a tiny detail 馃槄
This is my workaround:
export default {
methods: {
async logout () {
await this.$auth.logout()
this.$axios.setHeader('Authorization', null)
}
}
}
Or more simply (ref):
this.$axios.setToken(false)
Fixed in #84
Why this has been re-opened @pi0 ?
Fixed and released in 4.0.0.
Most helpful comment
Fixed and released in 4.0.0.