From 6415a35433d8a7e1bd5bf55a58defbc1a80fc0a6 Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Sat, 11 Jun 2016 07:25:25 +0800 Subject: [PATCH] Update google.js (#2023) Updated the authentication method of Google Sign-in (from v1 to v3) --- src/authDataManager/google.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/authDataManager/google.js b/src/authDataManager/google.js index c339eae904..ee82d278bd 100644 --- a/src/authDataManager/google.js +++ b/src/authDataManager/google.js @@ -4,9 +4,9 @@ var Parse = require('parse/node').Parse; // Returns a promise that fulfills iff this user id is valid. function validateAuthData(authData) { - return request("tokeninfo?access_token="+authData.access_token) + return request("tokeninfo?id_token="+authData.access_token) .then((response) => { - if (response && response.user_id == authData.id) { + if (response && response.sub == authData.id) { return; } throw new Parse.Error( @@ -23,7 +23,7 @@ function validateAppId() { // A promisey wrapper for api requests function request(path) { return new Promise(function(resolve, reject) { - https.get("https://www.googleapis.com/oauth2/v1/" + path, function(res) { + https.get("https://www.googleapis.com/oauth2/v3/" + path, function(res) { var data = ''; res.on('data', function(chunk) { data += chunk;