Use the correct function when validating google auth tokens (#5018)

* Use the correct function when validating google auth tokens

httpsRequest.request expects the param postData and has no default value
or validation to check if it is missing before using it. As a result, an
error `TypeError: First argument must be a string or Buffer` is
thrown when an attempt is made to authenticate with Google.

A quick check on the LinkedIn, FB, and twitter authentication adapters
shows they are using httpsRequest.get for their validation calls.

* Correct google auth adapter tests
This commit is contained in:
orette
2018-08-30 20:17:46 -04:00
committed by Florent Vilmart
parent 8c0a4430e0
commit c7357ed109
2 changed files with 7 additions and 7 deletions

View File

@@ -48,7 +48,7 @@ function validateAppId() {
// A promisey wrapper for api requests
function googleRequest(path) {
return httpsRequest.request("https://www.googleapis.com/oauth2/v3/" + path);
return httpsRequest.get("https://www.googleapis.com/oauth2/v3/" + path);
}
module.exports = {