From cd2053f2dde16c28765fc974d6c5c303821012a9 Mon Sep 17 00:00:00 2001 From: Nikola Bjelo Date: Mon, 5 Nov 2018 16:07:32 +0100 Subject: [PATCH] Correcting the userId fetching to avoid possible loops --- server/src/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/src/index.js b/server/src/index.js index 0ef91a3a2..aed90211f 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -18,12 +18,15 @@ async function getUserId (authId) { } const userData = await axios({ - url: process.env.GRAPHQL_API_URL, + url: process.env.USERS_API_URL, method: 'post', + headers: { + preshared: USERS_API_PRESHARED + }, data: { query: ` { - users_UserByAuthId(authId: "${authId}") + userByAuthId(authId: "${authId}") { id } @@ -31,7 +34,7 @@ async function getUserId (authId) { ` } }) - return userData.data.data.users_UserByAuthId.id + return userData.data.data.userByAuthId.id } catch (error) { return (error) }