From 278027a95587869364139a78473eb615cc0382e3 Mon Sep 17 00:00:00 2001 From: Florent Vilmart Date: Wed, 26 Oct 2016 11:44:56 -0400 Subject: [PATCH] Google auth: try to validate on both sub or user_id (#2922) --- src/authDataManager/google.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/authDataManager/google.js b/src/authDataManager/google.js index 7fd066a5..e5d121be 100644 --- a/src/authDataManager/google.js +++ b/src/authDataManager/google.js @@ -5,7 +5,7 @@ var Parse = require('parse/node').Parse; function validateIdToken(id, token) { return request("tokeninfo?id_token="+token) .then((response) => { - if (response && response.sub == id) { + if (response && (response.sub == id || response.user_id == id)) { return; } throw new Parse.Error( @@ -17,7 +17,7 @@ function validateIdToken(id, token) { function validateAuthToken(id, token) { return request("tokeninfo?access_token="+token) .then((response) => { - if (response && response.user_id == id) { + if (response && (response.sub == id || response.user_id == id)) { return; } throw new Parse.Error(