-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Form- (not json-) encode auth-params when POSTing to authUrl
- Loading branch information
1 parent
e2e8e5e
commit f3c6562
Showing
1 changed file
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,7 +262,16 @@ var Auth = (function() { | |
}; | ||
Logger.logAction(Logger.LOG_MICRO, 'Auth.requestToken().tokenRequestCallback', 'Sending; ' + authOptions.authUrl + '; Params: ' + JSON.stringify(authParams)); | ||
if(authOptions.authMethod && authOptions.authMethod.toLowerCase() === 'post') { | ||
Http.postUri(rest, authOptions.authUrl, authHeaders || {}, authParams, {}, authUrlRequestCallback); | ||
var headers = authHeaders || {}; | ||
if(typeof(authParams) === 'object') { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
SimonWoolf
Author
Member
|
||
/* send body form-encoded */ | ||
headers['content-type'] = "application/x-www-form-urlencoded"; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
body = Utils.toQueryString(authParams).slice(1); /* slice is to remove the initial '?' */ | ||
} else { | ||
headers['content-type'] = "text/plain"; | ||
body = authParams; | ||
} | ||
Http.postUri(rest, authOptions.authUrl, headers, body, {}, authUrlRequestCallback); | ||
} else { | ||
Http.getUri(rest, authOptions.authUrl, authHeaders || {}, authParams, authUrlRequestCallback); | ||
} | ||
|
1 comment
on commit f3c6562
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
authParams
here is the result ofUtils.mixin()
, why would it be anything other than an object?