Skip to content

Commit

Permalink
Properly set response_type in requestMagicLink
Browse files Browse the repository at this point in the history
  • Loading branch information
gnandretta committed Sep 29, 2015
1 parent ff45f5e commit 8895643
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1737,13 +1737,14 @@ Auth0.prototype.startPasswordless = function (options, callback) {
data.authParams = options.authParams;
}

if (this._shouldRedirect && !options.send || options.send === "link") {
if (!options.send || options.send === "link") {
if (!data.authParams) {
data.authParams = {};
}

data.authParams.redirect_uri = this._callbackURL;
data.authParams.response_type = this._callbackOnLocationHash ? "token" : "code";
data.authParams.response_type = this._shouldRedirect && !this._callbackOnLocationHash ?
"code" : "token";
}

if (options.send) {
Expand Down

0 comments on commit 8895643

Please sign in to comment.