I’ve encounter the Axios Error from the Axios response in regard of the maxContentLength
. I’ve tried to set to 100000, but it still encounter the same error. The API endpoint has successfully hit and endpoint get no error. No error in the Action debug test as well. Only happens when it runs in the Post User registration flow.
const axios = require("axios");
/**
* Handler that will be called during the execution of a PostUserRegistration flow.
*
* @param {Event} event - Details about the context and user that has registered.
*/
exports.onExecutePostUserRegistration = async (event) => {
const user = {
username: event.user.username ?? event.user.email,
firstName: event.user.given_name,
lastName: event.user.family_name,
email: event.user.email,
authProviderUserId: event.user.user_id
};
const baseUrl = "<baseUrl>";
await axios.post(`${baseUrl}/users`, user, {
headers: {
'Content-Type': 'application/json',
},
});
};
*Type
Failed Post User Registration Hook
- Description
AxiosError on post-user-registration: ERR_BAD_RESPONSE maxContentLength size of 100000 exceeded