Advertisement
Guest User

Untitled

a guest
Oct 31st, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. function Login(username, password, callback) {
  2. var user = {username:username, password:password};
  3. var data = JSON.stringify(user);
  4. $http.post('http://127.0.0.1:8000/socialnet/auth/',data)
  5. .success(function (response) {
  6. callback(response);
  7. })
  8. .error(function(response){
  9. alert("some error happened");
  10. });
  11. }
  12.  
  13. function login() {
  14. vm.dataLoading = true;
  15. AuthenticationService.Login(vm.username, vm.password, function (response) {
  16. AuthenticationService.SetCredentials(vm.username, vm.password,response.author);
  17. });
  18. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement