Open quantuminformation opened 6 years ago
@QuantumInformation I think we can make it an extra chapter possibly. It's not hard to do but it does complicate the app a bit more by having to create an extra screen.
But in case other folks find this thread here are some ideas on how to implement it.
getCurrentCognitoUser
from src/libs/awsLib.js
getUserToken
again from src/libs/awsLib.js
Finally, use the Cognito JS SDK changePassword
to change the user's password to the new one they set.
cognitoUser.changePassword('oldPassword', 'newPassword', function(err, result) {
if (err) {
alert(err);
return;
}
console.log('call result: ' + result);
});
These are the steps to change their password using the Cognito JS SDK but you still need to create a form in React to ask your user to type in their old password and the new password.
Similar to https://github.com/Qolzam/react-social-network/issues/36