自定义 AWS Cognito 托管 UI confirmForgotPassword 页面

Customize the AWS Cognito hosted UI confirmForgotPassword page

目前,通过提供的流程,模板以下列方式响应文本:

We have sent a password reset code by email to j***@t***.com. Enter it below to reset your password.

有没有办法更新和/或添加到此副本? 我在哪里可以找到这个模板?

上下文:

具有 nuxt 身份验证方案 oath2 的 Vue Nuxt 应用程序,authorization_endpoint 通过 AWS Cognito

.../confirmForgotPassword?response_type=token&client_id=XXXXXX&redirect_uri=XXX 等...

一如既往地感谢任何帮助和指导,提前致谢!

方法是使用 Cognito Custom Message Lambda。在 Cognito 中,您指定一个触发器来调用自定义 lambda 脚本。在 lambda 脚本中,您会收到一个事件对象,您可以编辑和设置您自己的消息。然后你 return 来自 lambda 的事件对象,仅此而已。它在 link.

中提供的示例脚本

好的,所以我找到了一个方法。这有点 hacky,但它完成了工作。

在托管的 css 中向文本范围添加 ::after 并将新副本放入该规则中。警告,这只是文本的添加与更改现有提供的副本。

此处概述了更新流程: https://docs.aws.amazon.com/cli/latest/reference/cognito-idp/set-ui-customization.html

#div-forgot-password-msg span::after {
  content: " additional text that will be displayed at the end of the existing copy."
}