title: Vue.JS Firebase redirect on successful auth
body: <p>I have the following Vue.js app structure (src directory):</p>
  <pre><code>.
  ├── App.vue
  ├── assets
  ├── data
  │   ├── config.js
  ├── main.js
  ├── router.js
  └── views
      └── app
          ├── index.vue
          ├── main
          │   ├── dashboard.vue
          │   └── index.vue
          ├── sessions
          │   ├── index.vue
          │   ├── login.vue
  </code></pre>
  <p>I already have implemented Firebase authentication, which works fine (refering to data/config.js). In my <strong>login.vue</strong>, I have the login form and a submit button:</p>
  <pre><code>&lt;b-form @submit.prevent=&quot;formSubmit&quot;&gt;
  ...
  &lt;b-button
     type=&quot;submit&quot;
  ...
  </code></pre>
  <p>which executes the formSubmit method:</p>
  <pre><code>&lt;script&gt;
  ...
    methods: {
      formSubmit() {
  
        firebase
          .auth()
          .signInWithEmailAndPassword(this.email, this.password)
          .then(data =&gt; {
            this.$router.push('/app/main/dashboard').catch((err) =&gt; {
              throw new Error(`${err}`);
            });
          })
          
          .catch(err =&gt; {
            console.log(&quot;not successful&quot;)
            this.error = err.message;
            alert(err.message);
          });
  
      },
    },
  ...
  &lt;/script&gt;
  </code></pre>
  <p>As said, authentication works, I just don't get the redirect to the start page when successfully authenticated to work. Using the code above, I get</p>
  <pre><code>Uncaught (in promise) Error: undefined
  </code></pre>
  <p>in the browser inspector. I assume this has something to do with the <strong>this</strong> statement, but I'm running out of ideas how I can rewrite this to get a successful redirect. Does anybody has a hint for me?</p>
  <p>Thanks!</p>