title: vuejs created hook: window/localstorage is not defined
body: <p>I would like to save authenticated user to localstorage and load them into vuex on the next page load:</p>
  
  <pre><code>created () {
      let user = window.localStorage.getItem('user')
      if(user) {
          this.setUser(JSON.parse(user))
      }
  }
  </code></pre>
  
  <p>I thought that the created hook in my root component would be the right place for this. Unfortunately I get 'window is not defined'.</p>
  
  <p>It works when I put it in the mounted hook instead. Unfortunately this is to late and shows the login page for a few ms.</p>
  
  <p>Where should I put this logic?</p>