[Vuejs]-Vue js, axios: 403 wrong access token even though its the right one

0๐Ÿ‘

โœ…

I removed the auth section and it worked! The auth section was this:

auth: {
              username: "username",
              password: "password"
            }

0๐Ÿ‘

you can add header object

 methods: { submitEmail() {   axios
        .post(
          "https://my_api.com/registrations?access_token=my_api_key"
          {
            language: this.language,
            user_email: this.postEmail,
            auth: {
              username: "username",
              password: "password"
            }
          }, 
{  headers: { 'Content-Type': 'application/json', 'Authorization': 'JWT fefege...' }  } )  .then(response =>  { // console.log(response); })  .catch(function(error) {}); } }

Leave a comment