Skip to content

Commit 6415a35

Browse files
MC0212drew-gross
authored andcommitted
Update google.js (#2023)
Updated the authentication method of Google Sign-in (from v1 to v3)
1 parent 11301d9 commit 6415a35

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/authDataManager/google.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ var Parse = require('parse/node').Parse;
44

55
// Returns a promise that fulfills iff this user id is valid.
66
function validateAuthData(authData) {
7-
return request("tokeninfo?access_token="+authData.access_token)
7+
return request("tokeninfo?id_token="+authData.access_token)
88
.then((response) => {
9-
if (response && response.user_id == authData.id) {
9+
if (response && response.sub == authData.id) {
1010
return;
1111
}
1212
throw new Parse.Error(
@@ -23,7 +23,7 @@ function validateAppId() {
2323
// A promisey wrapper for api requests
2424
function request(path) {
2525
return new Promise(function(resolve, reject) {
26-
https.get("https://www.googleapis.com/oauth2/v1/" + path, function(res) {
26+
https.get("https://www.googleapis.com/oauth2/v3/" + path, function(res) {
2727
var data = '';
2828
res.on('data', function(chunk) {
2929
data += chunk;

0 commit comments

Comments
 (0)