Skip to content

Commit 278027a

Browse files
authored
Google auth: try to validate on both sub or user_id (#2922)
1 parent f4fe19a commit 278027a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/authDataManager/google.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var Parse = require('parse/node').Parse;
55
function validateIdToken(id, token) {
66
return request("tokeninfo?id_token="+token)
77
.then((response) => {
8-
if (response && response.sub == id) {
8+
if (response && (response.sub == id || response.user_id == id)) {
99
return;
1010
}
1111
throw new Parse.Error(
@@ -17,7 +17,7 @@ function validateIdToken(id, token) {
1717
function validateAuthToken(id, token) {
1818
return request("tokeninfo?access_token="+token)
1919
.then((response) => {
20-
if (response && response.user_id == id) {
20+
if (response && (response.sub == id || response.user_id == id)) {
2121
return;
2222
}
2323
throw new Parse.Error(

0 commit comments

Comments
 (0)