title: OpenFB AngularJS getting the FBToken from local storage
body: <p>So, I have an Ionic app that requires a FB login, all is good but what I need to do is add 2 custom headers to every API request. Again, this should work... The issue I am having is that for some reason I am unable to grab the 'fbtoken' that is set on successful login. Here is some code: </p>
  
  <p><strong>LoginController:</strong></p>
  
  <pre><code>OpenFB.login('email, user_friends').then(
              function () {
                  OpenFB.get('/me').success(function (user) {
                      $localStorage.fbuser = user; //Set the user in local storage.
                  });
  
                  RequestService.get($scope.baseUrl + 'user')
                      .success(function(data, status, headers, config){
                          alert('Success!!!! ' + data);
                      }).error(function(data, status, headers, config){
                          if(status = 401) alert('Not Authorized!');
                      });
              },
              function (error) {
                  alert('OpenFB login failed' + error);
              });
      };
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>.config(function($stateProvider, $urlRouterProvider, $httpProvider) {
  
          $httpProvider.interceptors.push(function($q, $localStorage) {
              console.log($localStorage);
              return {
                  'request': function(config) {
  
                      config.headers['Auth-Token'] = JSON.parse(localStorage.get("fbtoken"));
                      config.headers['Auth-Provider'] = 'facebook';
                      return config;
                  }
              };
          });
  });
  </code></pre>
  
  <p>I can access the fbuser from local storage that is being set in the controller. The only difference between fbuser &amp; fbtoken if I take a look in Chrome Inspector is that the names are different:</p>
  
  <pre><code>fbtoken
  ngStorage-fbuser
  </code></pre>
  
  <p>Is this the issue? can I get the value of fbtoken in to my inceptor?</p>