[Vuejs]-How to save the token in the authifitication of the headers in Axios using Vuex?

0👍

You can use @nuxtjs/axios module with nuxt. It will be easier than configuring it yourself.
here is how you can do it with that module.

In your vuex action after you get token try this.$axios.setToken(<idToken>, 'bearer') and for common auth this.$axios.setToken('<token>').

Here is documentation related to it

0👍

You should never touch any tokens or cookies with javascript in your application.

If you can read/write any cookies/tokens with your javscript, then your application can be XSS attacked

Use axios.withCredentials = true for your auth

Leave a comment