This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #10 from mnoorenberghe/patch-1

Don't alias navigator.id
  • Loading branch information...
lloyd committed Jun 6, 2012
2 parents e848a35 + b0fe67d commit 9404edb50c04b76e86814cdf2a1784a3a038b21e
Showing with 3 additions and 7 deletions.
  1. +3 −7 static/browserid/provision.html
@@ -4,10 +4,6 @@
<script type="text/javascript" src="https://browserid.org/provisioning_api.js"></script>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript">
-
- // an alias
- var fail = navigator.id.raiseProvisioningFailure;
-
// begin provisioning! This both gives us indicated to browserid that we're
// a well formed provisioning page and gives us the parameters of the provisioning
navigator.id.beginProvisioning(function(email, cert_duration) {
@@ -17,7 +13,7 @@
.success(function(r) {
email = email.replace('@eyedee.me', '').toLowerCase();
if (email != r.user) {
- return fail('user is not authenticated as target user');
+ return navigator.id.raiseProvisioningFailure('user is not authenticated as target user');
}
// Awesome! The user is authenticated as who we want to provision. let's
@@ -39,13 +35,13 @@
navigator.id.registerCertificate(r.cert);
},
error: function(r) {
- fail("couldn't certify key");
+ navigator.id.raiseProvisioningFailure("couldn't certify key");
}
});
});
})
.error(function() {
- fail('user is not authenticated');
+ navigator.id.raiseProvisioningFailure('user is not authenticated');
});
});
</script>

0 comments on commit 9404edb

Please sign in to comment.