0

At some point between editing my code I had at least a portion of this working but of course did not commit before those times.

project: https://github.com/Ampix0/ticker-for-robinhood;

Code issue: https://github.com/Ampix0/ticker-for-robinhood/blob/master/app/src/renderer/components/LoginPageView.vue

On line 26 you can see the login function, when it completes it is supposed to route to the next page, passing along the access token.

Error

TypeError: Cannot read property '$router' of undefined
    at eval (eval at <anonymous> (renderer.js:1574), <anonymous>:18:21)
Ampix0
  • 135
  • 1
  • 3
  • 11

1 Answers1

0

Basically is the same problem which I just answered a few days ago: Show error message in Vue js

Because you lost the this reference in .then(function (response) {..

Use arrow functions can solve this easily:

.then((response) => {
    this.$router.push({
        name: 'home-page',
        params: {
            authKey: response.data.token
        }
    })
})
Community
  • 1
  • 1
CodinCat
  • 15,530
  • 5
  • 49
  • 60