Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- InvalidParameterType: Expected params.Username to be a string
- forgotPassword(username: string){
- console.log("forgotPassword called for..", username);
- let appClientInfo = {
- "userpoolId": "pool ID",
- "appClientId": "client ID"
- }
- var poolData = {
- UserPoolId : appClientInfo.userpoolId, // Your user pool id here
- ClientId : appClientInfo.appClientId // Your client id here
- };
- var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData);
- console.log("userPool..",userPool);
- var userData = {
- Username : username,
- Pool : userPool
- };
- var cognitoUser = new AWSCognito.CognitoIdentityServiceProvider.CognitoUser(userData);
- console.log("cognitoUser..",cognitoUser);
- cognitoUser.forgotPassword({
- onSuccess: function (result) {
- // successfully initiated forgot password request
- console.log('CodeDeliveryData from forgotPassword: ' + result);
- this.router.navigate(['login']);
- },
- onFailure: function(err) {
- alert(err);
- console.log('error: ' + err);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement