Skip to content

Commit

Permalink
Update google.js (#2023)
Browse files Browse the repository at this point in the history
Updated the authentication method of Google Sign-in (from v1 to v3)
  • Loading branch information
MC0212 authored and drew-gross committed Jun 10, 2016
1 parent 11301d9 commit 6415a35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/authDataManager/google.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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;
Expand Down

0 comments on commit 6415a35

Please sign in to comment.