Closed Josephenoch closed 8 months ago
Hello @Josephenoch, and thank you for opening this issue. Can you verify if the Verify Auth Challenge Lambda has been granted CloudWatch logging permissions for its execution role? It sounds like if you've already tried deleting and reinitializing the project, it's safe to say this is not a result of the 5-10 minutes it can take before logs show up after function invocation.
@Josephenoch, wanted to follow up and ask if you're able to see any logs on the network tab tied to your calls of Auth.sendCustomChallengeAnswer
? Can you detail what the response is when it's called or share a screenshot as well?
Sorry about the delay. I've confirmed and all the permissions are set. Also, it's an expo based project with react native. Here is a screenshot of the error I get when I run Auth.sendCustomChallengeAnswer
Is there any update on this? it's a major blocker for a product I'm to work on.
Hi @Josephenoch following up here - I also wanted to mention that if you do not see any cloudwatch logs for a Lambda function, it can also mean that the lambda function has never been invoked thus has never written any logs.
Can you confirm if this is true? If you are still not seeing any cloud watch logs for the verify lambda, then you can try do do a test invocation in the lambda console and see if any new logs are generated. If you do see some after the test invocation, it means that your custom auth flow is not invoking the verify lambda function due to a separate issue.
Hi @Josephenoch following up here, let me know if you still need assistance with this. If not I'll go ahead and close out this issue soon. Thanks!
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Authentication
Amplify Categories
auth
Environment information
Describe the bug
I have created a custom auth flow for passwordless authentication. As a result, I created and configured the three lambda functions required, ie. the create, define and verify auth challenge. I also added pre-signup to verify every user (because immediately after signing up, we send them the signup challenge, which is an OTP code).
The define and create auth challenge works well, but the verify doesn't work. I get the error:[TypeError: undefined is not a function] when I run Auth.sendCustomChallengeAnswer(cognitoUser, code). I discovered that the verify lambda function cannot be found on cloud watch. I've deleted and reinitialized the project, but the error persists
Expected behavior
The verify auth challenge should show in the lambda cloud watch and Auth.sendCustomChallengeAnswer(cognitoUser, code) should work.
Reproduction steps
Code Snippet
Log output
aws-exports.js
/ eslint-disable / // WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
const awsmobile = { "aws_project_region": "eu-central-1", "aws_cognito_identity_pool_id": "eu-central-1:xxxxxxxxxxxx", "aws_cognito_region": "eu-central-1", "aws_user_pools_id": "eu-central-xxxxxx", "aws_user_pools_web_client_id": "xxxxxxxx", "oauth": {}, "aws_cognito_username_attributes": [ "EMAIL" ], "aws_cognito_social_providers": [], "aws_cognito_signup_attributes": [ "EMAIL" ], "aws_cognito_mfa_configuration": "OFF", "aws_cognito_mfa_types": [ "SMS" ], "aws_cognito_password_protection_settings": { "passwordPolicyMinLength": 8, "passwordPolicyCharacters": [] }, "aws_cognito_verification_mechanisms": [ "PHONE_NUMBER" ] };
export default awsmobile;
Manual configuration
No response
Additional configuration
No response
Mobile Device
Iphone 14 Pro Max
Mobile Operating System
IOS16
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots