Advertisement
Guest User

Untitled

a guest
May 19th, 2016
754
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. svc.login = function(username, password) {
  2. return $http.post(apiEndpoint + 'authenticate', {
  3. username: username,
  4. password: password
  5. })
  6. .then(function(val) {
  7. console.log("user token:", val.data);
  8. svc.token = val.data;
  9. });
  10. };
  11.  
  12. svc.login = function(username, password) {
  13. svc.authenticateApi().post(apiEndpoint + 'authenticate', {
  14. username: username,
  15. password: password
  16. },
  17. function(val) {
  18. console.log("user token:", val);
  19. svc.token = val;
  20. },
  21. function(res) {
  22. console.log("error:", res.status + " " + res.statusText);
  23. });
  24.  
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement