Created
January 20, 2015 22:56
-
-
Save simonmorley/3d6c4537b3d8d8e55678 to your computer and use it in GitHub Desktop.
Medium, creating a login page, full login.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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