Cognito adminUpdateUserAttributes #5188
Answered
by
yenfryherrerafeliz
srinivas-mytend
asked this question in
Q&A
-
What's the equivalent of the below code to in v3 ?
|
Beta Was this translation helpful? Give feedback.
Answered by
yenfryherrerafeliz
Sep 11, 2023
Replies: 2 comments
-
Hi @srinivas-mytend, here is your v2 code converted to v3: import {
AdminDisableUserCommand,
AdminUpdateUserAttributesCommand,
CognitoIdentityProviderClient
} from "@aws-sdk/client-cognito-identity-provider";
const provider = new CognitoIdentityProviderClient({
region: "eu-central-1",
credentials: {
accessKeyId: "AKIAW5QRNEDNWUG67MM7",
secretAccessKey: ""
}
});
const adminChangeEmail = async () => {
await provider.send(new AdminDisableUserCommand({
Username: "c27bef38-7e3d-4862-865d-84e4be221b4a",
UserPoolId: "poolId"
}));
await provider.send(new AdminUpdateUserAttributesCommand({
UserAttributes: [
{
Name: 'email',
Value: '1671784812855_test@test.com'
},
{
Name: 'email_verified',
Value: true
},
],
UserPoolId: 'poolId',
Username: 'c27bef38-7e3d-4862-865d-84e4be221b4a'
}))
}
adminChangeEmail(); I recommend you to read our upgrading guide here. Please let me know if that helps! Thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
yenfryherrerafeliz
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @srinivas-mytend, here is your v2 code converted to v3: