diff --git a/js/id/oauth.js b/js/id/oauth.js index ec6a12668..9ed8eaa31 100644 --- a/js/id/oauth.js +++ b/js/id/oauth.js @@ -73,17 +73,13 @@ iD.OAuth = function(context) { ['top', screen.height / 2 - h / 2]].map(function(x) { return x.join('='); }).join(','), - popup = window.open("about:blank", 'oauth_window', settings), - locationCheck = window.setInterval(function() { - if (popup.closed) return window.clearInterval(locationCheck); - if (popup.location.search) { - var search = popup.location.search, - oauth_token = ohauth.stringQs(search.slice(1)); - popup.close(); - get_access_token(oauth_token); - window.clearInterval(locationCheck); - } - }, 100); + popup = window.open("about:blank", 'oauth_window', settings); + + window.authComplete = function(token) { + var oauth_token = ohauth.stringQs(token); + get_access_token(oauth_token); + delete window.authComplete; + }; function reqTokenDone(err, xhr) { if (err) callback(err); diff --git a/land.html b/land.html index 48fa3c09a..e03f34ee3 100644 --- a/land.html +++ b/land.html @@ -1,23 +1,9 @@ - -
- -