Skip to content

Instantly share code, notes, and snippets.

@simonmorley
Created January 20, 2015 22:56
Show Gist options
  • Save simonmorley/3d6c4537b3d8d8e55678 to your computer and use it in GitHub Desktop.
Save simonmorley/3d6c4537b3d8d8e55678 to your computer and use it in GitHub Desktop.
Medium, creating a login page, full login.
var doLogin = function(username, password, challenge) {
var createLogin = function() {
return Tony.create({username: username, password: password, challenge: challenge, request_uri: $location.host(), clientMac: $routeParams.mac}).$promise.then(function(res) {
scope.username = res.username;
scope.response = res.challengeResp;
}, function(err) {
// Fail Login
});
},
coovaLogin = function() {
return Coova.logon({uamip: $routeParams.uamip, uamport: $routeParams.uamport, username: scope.username, response: scope.response}).$promise.then(function(res) {
console.log('Yes, you\' in!', res);
});
};
createLogin().then(coovaLogin);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment