Open erickotsuka opened 6 months ago
Hi @erickotsuka, sorry you're experiencing this issue.
Can you please clarify step 1 of your reproduction steps? Where is this override occurring?
What version of Amplify CLI are you using?
Can you also please provide your amplifyconfiguration.dart
file, making sure to remove any sensitive data?
Ideally I should make a minimal example, I can do that in a few days, but for now I will try to describe it. If it is not enough information, I can provide a minimal example later.
amplify add auth
event.response.autoConfirmUser
to true
and return the event.amplify override auth
. This should create the file amplify/backend/auth/<app name>/override.ts
import {
AmplifyAuthCognitoStackTemplate,
AmplifyProjectInfo,
} from '@aws-amplify/cli-extensibility-helper'
export function override(resources: AmplifyAuthCognitoStackTemplate, _: AmplifyProjectInfo) { resources.userPool.emailVerificationMessage = undefined resources.userPool.emailVerificationSubject = undefined resources.userPool.verificationMessageTemplate = { defaultEmailOption: 'CONFIRM_WITH_LINK', emailMessageByLink: 'Please click the link below to verify your email address. {##Verify Email##}', emailSubjectByLink: 'Verify your email', } }
8. Change the on pressed callback for the sign up button to call, awaiting each call: `Amplify.Auth.signUp(email, password)`, then `Amplify.Auth.signIn(email, password)` and then `Amplify.Auth.sendUserAttributeVerificationCode(userAttributeKey: AuthUserAttributeKey.email)`.
9. `amplify push`
10. Run the flutter app for android in the android emulator
11. Enter a valid email and a password, then click on the sign up button
12. Check the email received. The issue is that the email being sent is with a verification code instead of a verification link
I am using version 12.10.1 of the amplify CLI.
@erickotsuka this is really helpful, thank you. It should be sufficient to reproduce. We'll investigate and provide an update when we can.
Hi @erickotsuka, I followed your reproduction steps and was able to reproduce this issue. I'm going to mark it as a bug and we are going to discuss it as a team and will keep you updated on the next steps of this issue, thanks.
@erickotsuka - After speaking with Cognito, using a link confirmation is not supported for attribute confirmation. It is only supported for sign up confirmation. I will update this to a feature request. However, this would first require Cognito to support it.
Description
Even after overriding and setting the verification message template to CONFIRM_WITH_LINK, the method
Amplify.Auth.sendUserAttributeVerificationCode
still sends a code via email, ignoring what is configured in AWS Cognito. There is no method for verification link. For context, the user is being auto-confirmed during the pre-sign up Lambda trigger. After the user signs in, I want to ask them to verify the email via link.Categories
Steps to Reproduce
Amplify.Auth.sendUserAttributeVerificationCode(userAttributeKey: AuthUserAttributeKey.email);
somewhere in the app after the user is signed inScreenshots
No response
Platforms
Flutter Version
3.19.2
Amplify Flutter Version
1.6.1
Deployment Method
Amplify CLI
Schema
No response