Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- svc.login = function(username, password) {
- return $http.post(apiEndpoint + 'authenticate', {
- username: username,
- password: password
- })
- .then(function(val) {
- console.log("user token:", val.data);
- svc.token = val.data;
- });
- };
- svc.login = function(username, password) {
- svc.authenticateApi().post(apiEndpoint + 'authenticate', {
- username: username,
- password: password
- },
- function(val) {
- console.log("user token:", val);
- svc.token = val;
- },
- function(res) {
- console.log("error:", res.status + " " + res.statusText);
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement