Skip to content

Commit

Permalink
Merge branch 'Fixes/0.2.4' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
william26 committed Aug 4, 2014
2 parents 012b01d + da75c04 commit 850aac1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions www/coffee/lib/oauth.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ module.exports = (window, document, jQuery, navigator) ->
opts.callback new Error("unable to receive token")
defer?.reject new Error("unable to receive token")
return
wnd.addEventListener "exit", () ->
defer?.reject new Error("The popup was closed")
opts.callback new Error("The popup was closed") if opts.callback and typeof opts.callback == "function"

return defer?.promise()
clearCache: (provider) ->
Expand Down
8 changes: 8 additions & 0 deletions www/dist/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,14 @@ module.exports = function(window, document, jQuery, navigator) {
}
}
});
wnd.addEventListener("exit", function() {
if (defer != null) {
defer.reject(new Error("The popup was closed"));
}
if (opts.callback && typeof opts.callback === "function") {
return opts.callback(new Error("The popup was closed"));
}
});
return defer != null ? defer.promise() : void 0;
},
clearCache: function(provider) {
Expand Down
2 changes: 1 addition & 1 deletion www/dist/oauth.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions www/js/lib/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ module.exports = function(window, document, jQuery, navigator) {
}
}
});
wnd.addEventListener("exit", function() {
if (defer != null) {
defer.reject(new Error("The popup was closed"));
}
if (opts.callback && typeof opts.callback === "function") {
return opts.callback(new Error("The popup was closed"));
}
});
return defer != null ? defer.promise() : void 0;
},
clearCache: function(provider) {
Expand Down

0 comments on commit 850aac1

Please sign in to comment.