User authentication service for AngularJS