Skip to content

Commit 730f5c5

Browse files
authored
Allow test credentials for Facebook Auth (#5466)
* Allow test credentials for Facebook Auth * node_env testing
1 parent edf5b51 commit 730f5c5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Adapters/Auth/facebook.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ function validateAuthData(authData) {
77
return graphRequest(
88
'me?fields=id&access_token=' + authData.access_token
99
).then(data => {
10-
if (data && data.id == authData.id) {
10+
if (
11+
(data && data.id == authData.id) ||
12+
(process.env.TESTING && authData.id === 'test')
13+
) {
1114
return;
1215
}
1316
throw new Parse.Error(
@@ -20,6 +23,9 @@ function validateAuthData(authData) {
2023
// Returns a promise that fulfills iff this app id is valid.
2124
function validateAppId(appIds, authData) {
2225
var access_token = authData.access_token;
26+
if (process.env.TESTING && access_token === 'test') {
27+
return Promise.resolve();
28+
}
2329
if (!appIds.length) {
2430
throw new Parse.Error(
2531
Parse.Error.OBJECT_NOT_FOUND,

0 commit comments

Comments
 (0)