title: JSON unexpected token at Object.parse
body: <p>I am working with Spring Security and trying to display role of the user that is loged in. </p>
  
  <p>Spring Sec is functioning - I have working register and login JS functions(I can see new user in database, and I can do a valid login) but when I try to get role info for the current user and display it via simple {{role}} in simple html file in frontend i get this error:</p>
  
  <p><img src="https://i.stack.imgur.com/02RV0.png" alt="enter image description here"></p>
  
  <p>But I still get a valid response from JSON:</p>
  
  <p><img src="https://i.stack.imgur.com/JM0Fd.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/XWfTD.png" alt="enter image description here"></p>
  
  <p>This is my user.html where data-ng-init and {{role}} are:</p>
  
  <pre><code>&lt;div class="masthead"&gt;
      &lt;h4 class="text-center" data-ng-init="init()"&gt;
          &lt;strong&gt;Users Home Screen&lt;/strong&gt;
      &lt;/h4&gt;
      &lt;p&gt;{{role}}&lt;/p&gt;
      &lt;br&gt;
  ...
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my userController.js (it's connected to user.html via app.js):</p>
  
  <pre><code>collectionsApp.controller('userController', function($scope, userService,
          $state) {
      $scope.init = function() {
          userService.getAuthorization(displayRole);
      }
  
      displayRole = function(response) {
          $scope.role = response.data;
      }
  
  });
  </code></pre>
  
  <p>My userService.js:</p>
  
  <pre><code>collectionsApp.service('userService', function($http) {
      return {
          login : function(user, callback) {
              $http.post('/user/login', user).then(callback);
          },
          register : function(user, callback) {
              $http.post('/user/add', user).then(callback);
          },
  
          getAuthorization : function(callback) {
              $http.get('/user/getAuthorization').then(callback);
          }
  
      };
  }); 
  </code></pre>
  
  <p>My UserController.java (only function of interest is displayed in this post):</p>
  
  <pre><code>@RequestMapping(value = "/getAuthorization", method = RequestMethod.GET)
  public String getAuthorization() {
  return SecurityContextHolder.getContext().getAuthentication().getAuthorities().toString();
  }
  </code></pre>
  
  <p>Oh, and one more strange thing: 
  When I put break-point, like shown on image below, and hit f5 on user.html, debugging acts like it never reaches the break point and reports mentioned SyntaxError in console. That is rather paranormal if you ask me... :)</p>
  
  <p><img src="https://i.stack.imgur.com/FwPso.png" alt="enter image description here"></p>