title: Access the `access_token` property in localstorage
body: <p>I have saved the token in localstorage: localStorage.setItem ('token', JSON.stringify (res.data)). I am trying to access the <code>access_token</code> property.</p>
  
  <p><code>JSON.parse(localStorage.getItem(token['access_token']))</code></p>
  
  <p>It gets error: <code>token is undefined</code>;</p>
  
  <pre><code> getToken = () =&gt; {  
      const config = {
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded'
        }
      }
  
      const url = '/oauth2/token';
  
      axios({ 
        method: 'post', 
        url, 
        data, 
        config
      }) 
        .then(res =&gt; { 
          if (res.status === 200) {
            localStorage.setItem('token', JSON.stringify(res.data))
            this.setState({
              token: res.data
            })
  
          } else {
            const error = new Error(res.error);
            throw error;
          }
        }).catch(err =&gt; { 
          console.error(err);
          alert('error'); 
        });
    }
  </code></pre>