Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .factory('loginFactory', ['$http', function(http){
- var methods = {
- logUser : function(user,pass){
- return http({
- method : 'POST',
- url : 'rest/auth',
- data : "username="+user+"&password="+pass, // pass in data as strings
- headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
- });
- },
- currentLoggedUser : function () {
- return http.get('rest/auth?op=get');
- },
- closeSession : function() {
- return http.get('rest/auth?op=close');
- }
- }
- return methods;
- }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement