到目前为止,我只能发送带有验证码的电子邮件,而不能发送链接,无论我选择“验证类型”“代码”还是“链接”,验证码都会以任何一种方式发送。我还为我的用户池设置了一个认知域。我还漏掉了什么吗?
我遇到了类似的问题 - Lambda 发送了一个身份验证链接而不是身份验证代码,因为我在选择
Walkthrough all the auth configurations
时不知不觉地添加了一个 lambda 自定义消息函数? What do you want to do?
在“amplify add auth”cli 流程中。
此 AWS 文档 表示“您可以在原始 Amazon Cognito 控制台的消息自定义选项卡中编辑静态自定义消息。”但我遇到了与您相同的问题 - 在 Amplify Studio 或 Cognito 控制台中更改设置后,后端没有更改。
我终于在这个 aws-amplify / amplify-cli github 问题中找到了一个有前途的解决方案
这是我必须采取的步骤:
app % amplify update auth
Please note that certain attributes may not be overwritten if you choose to use defaults settings.
You have configured resources that might depend on this Cognito resource. Updating this Cognito resource could have unintended side effects.
Using service: Cognito, provided by: awscloudformation
What do you want to do? Walkthrough all the auth configurations
Select the authentication/authorization services that you want to use: User Sig
n-Up, Sign-In, connected with AWS IAM controls (Enables per-user Storage feature
s for images or other content, Analytics, and more)
Allow unauthenticated logins? (Provides scoped down permissions that you can co
ntrol via AWS IAM) Yes
Do you want to enable 3rd party authentication providers in your identity pool?
Yes
Select the third party identity providers you want to configure for your identi
ty pool: Google
You've opted to allow users to authenticate via Google. If you haven't already
, you'll need to go to https://developers.google.com/identity and create an App
ID.
Enter your Google Web Client ID for your identity pool
<Client ID>.apps.googleusercontent.com
Do you want to add User Pool Groups? No
Do you want to add an admin queries API? No
Multifactor authentication (MFA) user login options: OFF
Email based user registration/forgot password: Enabled (Requires per-user email
entry at registration)
Specify an email verification subject: Your verification code
Specify an email verification message: Your verification code is {####}
Do you want to override the default password policy for this User Pool? No
Specify the app's refresh token expiration period (in days): 30
Do you want to specify the user attributes this app can read and write? No
Do you want to enable any of the following capabilities?
Do you want to use an OAuth flow? Yes
What domain name prefix do you want to use? claimsexaminer
Which redirect signin URIs do you want to edit? http://localhost:3000/, https:/
/<amplify id>_<env-name>.amplifyapp.com/
? Update http://localhost:3000/ http://localhost:3000/
? Update https://<amplify id>_<env-name>.amplifyapp.com/ https://<amplify id>_<env-name>.amplifyapp.com/
Do you want to add redirect signin URIs? Yes
Enter your new redirect signin URI: http://localhost:3000/
? Do you want to add another redirect signin URI Yes
Enter your new redirect signin URI: https://<amplify id>_<env-name>.amplifyapp.c
om/
? Do you want to add another redirect signin URI No
Which redirect signout URIs do you want to edit?
Do you want to add redirect signout URIs? Yes
Enter your new redirect signout URI: http://localhost:3000/
? Do you want to add another redirect signout URI Yes
Enter your new redirect signout URI: https://<amplify id>_<env-name>.amplifyapp.
com/
? Do you want to add another redirect signout URI No
Select the OAuth flows enabled for this project. Authorization code grant
Select the OAuth scopes enabled for this project. Phone, Email, OpenID, Profile
, aws.cognito.signin.user.admin
Select the identity providers you want to configure for your user pool: Google
You've opted to allow users to authenticate via Google. If you haven't already
, you'll need to go to https://developers.google.com/identity and create an App
ID.
Enter your Google Web Client ID for your OAuth flow: <Client ID>.apps.googleusercontent.com
Enter your Google Web Client Secret for your OAuth flow: <Client Secret>
? Do you want to configure Lambda Triggers for Cognito? Yes
? Which triggers do you want to enable for Cognito
Removing resource <amplify-automated-prefix>CustomMessage...
✅ Successfully removed resource
✅ Successfully updated auth resource <amplify-automated-app_name> locally
✅ Some next steps:
"amplify push" will build all your local backend resources and provision it in the cloud
"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud
✅ Successfully updated resource update locally
✅ Some next steps:
"amplify push" will build all your local backend resources and provision it in the cloud
"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud
app % amplify push
放大推送完成后,我在 Amplify Studio -> 用户管理控制台中删除了该用户。然后我再次使用电子邮件/用户名和 HAZAH 登录! Lambda 发出验证码。