-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verification Codes are not sent for Amplify Auth #3530
Comments
@dan-codes1 Thanks for opening the issue. I can acknowledge that the documentation needs to be updated and I can work on updating it as soon as possible. Regarding the email not being sent, are you using the default email service provided by Cognito or Amazon SES. If you are using Amazon SES, In the sandbox, Amazon SES imposes restrictions on how many emails you can send and where you can send them. If you are using the default Amazon Cognito provided email service and using a custom email address. Before you can use your custom email address, you must verify it with Amazon SES and grant Amazon Cognito permission to use this address. Just make sure you also check your Spam folder on the receivers mailbox. From the logs, i can see that everything looks good, so it is definitely a service configuration that might be an issue. |
@harsh62 I am using the default cognito address. I noticed that the confirmation email is sent initially but if for some reason, the app decides to resend it, the email does not get sent; even after refereshing the app (closing and opening it). |
@dan-codes1 Just curious if the deprecated API is working and sending the email multiple times? |
@harsh62 It actually works fine and sends all emails for both APIs. It turns out that subsequent emails are sent to the users spam. |
|
Describe the bug
The api for sending confirmation codes to users' email does not work. The api does not return an error, but the verification code is just not sent.
The api I am using is:
try await Amplify.Auth.sendVerificationCode(forUserAttributeKey: .email)
The console log for the api prints:
2024-02-18T11:16:29-0700 info CognitoIdentityProviderClient : [Logging] Request: POST https:443
Path: /
Content-Type: application/x-amz-json-1.1,
Host: cognito-idp.us-east-1.amazonaws.com,
User-Agent: aws-sdk-swift/1.0 ua/2.0 api/cognito_identity_provider#1.0 os/ios#17.2.0 lang/swift#5.9 cfg/retry-mode#legacy,
X-Amz-Target: AWSCognitoIdentityProviderService.GetUserAttributeVerificationCode,
Content-Length: 1134
nil
2024-02-18T11:16:29-0700 info SerialExecutor : [Logging] Creating connection pool for cognito-idp.us-east-1.amazonaws.com with max connections: 50
2024-02-18T11:16:29-0700 info CRTClientEngine : [Logging] Connection was acquired to: Optional("https://cognito-idp.us-east-1.amazonaws.com/")
2024-02-18T11:16:29-0700 info CRTClientEngine : [Logging] Using HTTP/1.1 connection
2024-02-18T11:16:29-0700 info HttpContent : [Logging] read 1134 bytes from data
2024-02-18T11:16:29-0700 info CRTClientEngine : [Logging] Main headers received
2024-02-18T11:16:29-0700 info CRTClientEngine : [Logging] Body chunk received
2024-02-18T11:16:29-0700 info CRTClientEngine : [Logging] Request/response completed
AuthCodeDeliveryDetails(destination: Amplify.DeliveryDestination.email(Optional("d***@g***")), attributeKey: Optional(Amplify.AuthUserAttributeKey.email))
But the email is not sent
Also:
I noticed a discrepancy between the amplify-swift documentation, and the amply-swift api.
The docs here: https://docs.amplify.aws/swift/build-a-backend/auth/managing-attributes/ say that to resend verification codes, you use api:
let deliveryDetails = try await Amplify.Auth.resendConfirmationCode(forUserAttributeKey: .email)
but that api seems to deprecated in Xcode for the amplify-swift 2.26.1 version.Steps To Reproduce
Expected behavior
Amplify Framework Version
2.26.1
Amplify Categories
Auth
Dependency manager
Swift PM
Swift version
5.9.2
CLI version
12.10.1
Xcode version
15.2
Relevant log output
Is this a regression?
No
Regression additional context
No response
Platforms
iOS
OS Version
iOS 16
Device
iPhone 15 pro
Specific to simulators
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: