Verification Codes are not sent for Amplify Auth #3530
Labels
auth
Issues related to the Auth category
documentation
Documentation improvements
question
General question
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: