1 回答
- 最新
- 投票最多
- 评论最多
0
【以下的回答经过翻译处理】 这个问题已经解决了。需要的人可以按照以下步骤操作:
首先将下面的代码引入你的项目中:
import {
Authenticator,
Heading,
Text,
ThemeProvider,
Theme,
useTheme,
View,
useAuthenticator,
Button,
} from '@aws-amplify/ui-react'
然后在你的应用程序中添加授权提供者:
<Authenticator
hideSignUp={true}
formFields={formFields}
components={components}
>
<Layout>
<main>
<Component previousPathname={previousPathname} {...pageProps} />
</main>
</Layout>
</Authenticator>
最后配置表单字段即可:
const formFields = {
setupTOTP: {
QR: {
totpIssuer: `CompanyName - ${process.env.NEXT_PUBLIC_ENV}`,
totpUsername: email,
},
...
},
}
相关内容
- AWS 官方已更新 3 个月前
- AWS 官方已更新 2 年前