Is there a way to customize the error from cognito trigger lambda?
export async function handler(event: PreSignUpTriggerEvent, context: Context, callback: Callback<PreSignUpTriggerEvent>): Promise<void> {
console.log(event);
// Return to Amazon Cognito
callback(message, event);
}
This would return the following error to my callback url
http://localhost:3000/?error_description=PreSignUp+failed+with+error+Error%3A+User+not+exists+in+the+system.+Access+deny.+&error=invalid_request
I understand its not possible to change the error_description to remove the PreSignUp+failed+with+error prefix (reference).
However, is it possible to customize the error=invalid_request query param to error=access_denied or anything custom error other than invalid_request?
