diff --git a/examples/javascript/src/lib/jane-service.mjs b/examples/javascript/src/lib/jane-service.mjs index a8b2635..b657125 100644 --- a/examples/javascript/src/lib/jane-service.mjs +++ b/examples/javascript/src/lib/jane-service.mjs @@ -32,8 +32,8 @@ const createUser = async (data, token) => { // } // } -const ensureExternalUserExists = async (data) => { - const response = await apiService.post(`${COGNITO_API}/ensure_external_user_exists`, data) +const ensureExternalUserExists = async (data, token) => { + const response = await apiService.post(`${COGNITO_API}/ensure_external_user_exists`, data, token) return { success: response.statusCode === 200, @@ -134,16 +134,16 @@ const verifySSOUser = async (data, token) => { const parsedData = { ...data, user_attributes: { - ...data.user_attributes, + ...data.user_attributes, identities: JSON.parse(data.user_attributes.identities) - } - } + } + } const response = await apiService.post( `${COGNITO_API}/verify_sso_user`, parsedData, token ) - + const result = { errorMessage: "", user: response.body?.user, diff --git a/examples/javascript/src/pre-signup-lambda/index.mjs b/examples/javascript/src/pre-signup-lambda/index.mjs index 23684d2..ea11e11 100644 --- a/examples/javascript/src/pre-signup-lambda/index.mjs +++ b/examples/javascript/src/pre-signup-lambda/index.mjs @@ -26,7 +26,7 @@ export const handler = async (event) => { external_id: event.userName, email: userData.email, user_attributes: userData.user_attributes, - }) + }, token) if (!success) { throw new Error(`ensureExternalUserExists was not successful: ${errorMessage}`)