[Vuejs]-CORS error in .then clause of HTTP request

-1👍

This might not actually be a CORS issue. this inside the .then callback is bound to the callback, and not to the Vue instance.

To test this idea, on the first line of the signup function, do this…

signup: function () {
  const vm = this
  ...

and then inside the callback use vm instead of this

.then(response => {
  ...
  vm.$router.push(...)

If that works, then make sure to also do vm.pass_or_fail=response.body

Leave a comment