Authentication layer for AngularJS