diff --git a/tasks.txt b/tasks.txt index 3d4fffc..17e9631 100644 --- a/tasks.txt +++ b/tasks.txt @@ -22,8 +22,6 @@ Tasks: * First experience clicking on the share button -* Make sure name next to tab is not hyperlinked - * If navigate away, first time, shrink the bar, tell them they can click on the share button to bring it back. @@ -34,7 +32,6 @@ Tasks: with new account info, let them know that account changed. * Rewrite retry screen * Rewrite error screen - * If deny facebook, then tell them "You denied it...," * Provide specialized positive feedback on first share * Provide positive feedback experience for every share * Indicate bookmarking is being done, option to opt out. @@ -45,8 +42,6 @@ Tasks: * Load facebook.com: grep for new Presence(\"100000423120383\". A bit brittle. * Both hit the web site, so triggers analytics/facebook may try to sign you into chat? Sound in the background? - * If user clicks add then does deny on oauth window, need to capture the failure and - tell the user about it. * If user clicks remove link, then add, always use OAuth forceLogin, but only for the remove/add case, not for first adds. diff --git a/web/scripts/oauth.js b/web/scripts/oauth.js index 21605d1..96795a0 100644 --- a/web/scripts/oauth.js +++ b/web/scripts/oauth.js @@ -34,9 +34,16 @@ function () { //Handle communication from the auth window, when it completes. window.addEventListener("message", function (evt) { //TODO: ideally lock down the domain check on evt.origin. - if (evt.data === 'authDone') { + var status = evt.data; + if (status) { + if (status === 'oauth_success') { + status = true; + } else { + status = false; + } + if (authDone) { - authDone(); + authDone(status); authDone = null; } } diff --git a/web/send/auth.html b/web/send/auth.html index 799735c..fcef952 100644 --- a/web/send/auth.html +++ b/web/send/auth.html @@ -18,10 +18,11 @@ require(["require", "jquery", "blade/url"], function (require, $, url) { var target = window.location.href.split('#')[1]; - if (target) { + if (target && (target === 'oauth_success' || target === 'oauth_failure')) { + //TODO: ideally lock down the domain be location.hostname, but //a problem for 127 addresses? - window.opener.postMessage('authDone', '*'); + window.opener.postMessage(target, '*'); window.close(); } var search = window.location.href.split('?')[1]; diff --git a/web/share/accounts.js b/web/share/accounts.js index 5e76a69..d41c54a 100644 --- a/web/share/accounts.js +++ b/web/share/accounts.js @@ -142,8 +142,10 @@ function (require, $, fn, rdapi, oauth, jig) { .delegate('.connectButton', 'click', function (evt) { var buttonNode = evt.target, domain = buttonNode.getAttribute('data-domain'); - oauth(domain, function () { - location.reload(); + oauth(domain, function (success) { + if (success) { + location.reload(); + } }); }) .delegate('.disconnectButton', 'click', function (evt) { diff --git a/web/share/index.html b/web/share/index.html index fe62d37..65fa257 100644 --- a/web/share/index.html +++ b/web/share/index.html @@ -173,6 +173,11 @@ + +