Skip to content

Commit

Permalink
fix Await JSON response from fetch
Browse files Browse the repository at this point in the history
This caused a bug lower down where we'd check

        if (Object.keys(profile).length !== 0) {

The JSON promise certainly has keys, but it's not quite what we want here.
  • Loading branch information
bheesham committed Dec 9, 2024
1 parent 631a486 commit 2664612
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tf/actions/activateNewUsersInCIS.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ exports.onExecutePostLogin = async (event, api) => {
// Throw an error if the response status code is not in the 200-299 range
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.json();
return await response.json();
} catch (error) {
throw Error(`Unable to retrieve profile from Person API: ${error}`);
}
Expand Down

0 comments on commit 2664612

Please sign in to comment.