有没有一种方法可以自定义Cognito触发Lambda的错误信息?
这将返回以下错误到我的回调URL。
export async function handler(event: PreSignUpTriggerEvent, context: Context, callback: Callback<PreSignUpTriggerEvent>): Promise<void> {
console.log(event);
// Return to Amazon Cognito
callback(message, event);
}
这将返回以下错误到我的回调URL。
http://localhost:3000/?error_description=PreSignUp+failed+with+error+Error%3A+User+not+exists+in+the+system.+Access+deny.+&error=invalid_request
我知道不可能更改error_description
以删除前缀PreSignUp+failed+with+error
(参考链接)。
不过,是否可以自定义error=invalid_request
查询参数为error=access_denied
或任何自定义错误而不是invalid_request
?
error_description
中是否有此常量。 - Fábio Filhoerror_description
中的前缀,或者使用自定义错误代替error=invalid_request
。 - srx