title: getCurrentUser().role undefined in DaftMonk/generator-angular-fullstack
body: <p>We are using the DaftMonk/AngularJS Full-Stack generator for a projet. The generated code contains the logic to manage users (registration, login, roles, etc.), which is great. However, there is an issue when using the code and the role of the current user is sometimes undefined.</p>
  
  <p>We encountered the issue as we wanted to implement a simple feature: after login/signup, the user should be redirected to a URL that depends on his role. For instance, <code>'teacher'</code> users should be redirected to <code>/teacherHome</code> and <code>'student'</code> users should be redirected to <code>/studentHome</code>. Because Auth.getCurrentUser().role is undefined, the logic does not work.</p>
  
  <p><strong>How to reproduce the issue</strong></p>
  
  <p>To reproduce the issue, edit the <code>client/app/account/login/login.controller.js</code> file and add statements to log the value of Auth.getCurrentUser().role, like so:</p>
  
  <pre><code>...
    if(form.$valid) {
      Auth.login({
        email: $scope.user.email,
        password: $scope.user.password
      })
      .then( function() {
        // Logged in, redirect to home
        console.log("Current user role: " + Auth.getCurrentUser().role);
        $location.path('/');
      })
      .catch( function(err) {
        $scope.errors.other = err.message;
      });
    }
  };
  ...
  </code></pre>
  
  <p>When testing this code, you will find out that the user role is undefined at this stage. Later on, however, it is assigned a value. This suggests that the issue might be related to an asynchronous REST call.</p>