Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sahat/satellizer
Browse files Browse the repository at this point in the history
# Conflicts:
#	satellizer.min.js
  • Loading branch information
sahat committed Nov 7, 2015
2 parents 75cce29 + bacd50e commit c19c567
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions satellizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,12 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex

provider.open(config.providers[name], userData || {})
.then(function(response) {
shared.setToken(response, false);
// This is for a scenario when someone wishes to opt out from
// Satellizer's magic by doing authorization code exchange and
// saving a token manually.
if (config.providers[name].url) {
shared.setToken(response, false);
}
deferred.resolve(response);
})
.catch(function(error) {
Expand Down Expand Up @@ -519,7 +524,11 @@ if (typeof module !== 'undefined' && typeof exports !== 'undefined' && module.ex

return openPopup
.then(function(oauthData) {
if (defaults.responseType === 'token') {
// When no server URL provided, return popup params as-is.
// This is for a scenario when someone wishes to opt out from
// Satellizer's magic by doing authorization code exchange and
// saving a token manually.
if (defaults.responseType === 'token' || !defaults.url) {
return oauthData;
}

Expand Down

0 comments on commit c19c567

Please sign in to comment.