Authentication component for AngularJs