Skip to content

Commit

Permalink
fix: api call missing auth token
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-sr88 committed Nov 20, 2023
1 parent f7ee71f commit b602b3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions examples/javascript/src/lib/jane-service.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion examples/javascript/src/pre-signup-lambda/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down

0 comments on commit b602b3c

Please sign in to comment.