best-businessperson-92294
03/03/2024, 6:12 AMlet request = {
"id": identity.id,
"updateIdentityBody": {
"credentials": {
"password": {
"config": {
"hashed_password": bcrypt.hashSync(userParam.password)
}
}
}
}
};
await oryIdentityApi.updateIdentity(request)
.catch((err) => {
console.log(`Could not update password for user: ${user.email}. Error: ${err}.`);
throw err;
});
And the error O'm getting is invalid character '}' looking for beginning of value
. Any idea what I might be doing wrong?best-businessperson-92294
03/04/2024, 1:52 AMconst identities = await oryIdentityApi.listIdentities({credentialsIdentifier: user.email});
const identity = identities.data[0];
const request = {
"id": identity.id,
"updateIdentityBody": {
"schema_id": identity.schema_id,
"traits": {
"email": identity.traits.email,
},
"state": "active",
"credentials": {
"password": {
"config": {
"hashed_password": bcrypt.hashSync(userParam.password)
}
}
}
}
};
await oryIdentityApi.updateIdentity(request)
.then((res) => {
console.log(`Successfully updated password for user: ${user.email}.`);
})
.catch((err) => {
console.log(`Could not update password for user: ${user.email}. Error: ${err}.`);
throw err;
});