Advertisement
Guest User

Untitled

a guest
May 15th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. .factory('loginFactory', ['$http', function(http){
  2. var methods = {
  3. logUser : function(user,pass){
  4. return http({
  5. method : 'POST',
  6. url : 'rest/auth',
  7. data : "username="+user+"&password="+pass, // pass in data as strings
  8. headers : { 'Content-Type': 'application/x-www-form-urlencoded' }
  9. });
  10. },
  11. currentLoggedUser : function () {
  12. return http.get('rest/auth?op=get');
  13. },
  14. closeSession : function() {
  15. return http.get('rest/auth?op=close');
  16. }
  17.  
  18. }
  19. return methods;
  20. }])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement