User authentication in Angular JS and PHP