Closed natuan62 closed 3 months ago
I try to add email value field like this https://github.com/pj4269/amplify-vite-react-template/blob/12be5f0d77ca9f182d3f33e29f1cc15d828676f8/src/components/Profile.tsx#L100 But it still not working
const email = '';
await sendUserAttributeVerificationCode({
userAttributeKey: 'email',
email, <======
} as SendUserAttributeVerificationCodeInput);
Hello @natuan62 . You should get a verification code when using the updateUserAttribute
API and then you should be able to confirm it using the confirmUserAttribute
API.
The sendUserAttributeVerificationCode
API can be used to send a code for an attribute that hasn't being verified yet. Sometimes you would create a user with phone_number
and email
but only one of them might end up being verified during the registration and login process.
@israx thanks for your reply. but when I using
await updateUserAttribute({
userAttribute: {
attributeKey: 'email',
value: formEmail.newEmail,
},
});
my email on cognito changed to new email, and email_verified set to false. but it didn't receive any email for verficiation code
Did i missing some config on amplify-js, aws-config or cognito etc ?
is email
configured to be an optional attribute ?
@israx Yes email is optional and i'm using email to signIn also
Before opening, please confirm:
JavaScript Framework
Vue
Amplify APIs
Authentication
Amplify Version
v6
Amplify Categories
auth
Backend
None
Environment information
Describe the bug
email
attributeKeyExpected behavior
sendUserAttributeVerificationCode will works fine
Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response