AWS Cognito- TruncatingBigNumber can not be converted to an String

Viewed 888
export class ChangePwComponent implements OnInit {
  user = '';
  code: string;
  password:string;
  // new_password:string;
  message = '';
  email = '';
  toVerifyEmail: boolean = false;
  signstatus: string = 'signin'
  username: string;
  userObject:any;
  constructor(private authService: AuthService, private router: Router, private api: APIService, private cookieService: CookieService, private https: HttpClient) { }

  ngOnInit() {
    this.username = this.router.getNavigatedData();
    console.log('username' + JSON.stringify(this.username));
    console.log(environment.envName);
  }

  changePw(password: HTMLInputElement) {
    const user = {
      password: password,
    }
    console.log(user)    
    Auth.forgotPasswordSubmit(this.password,this.code, this.username)
    .then(user => console.log(user))
    .catch(err => console.log(err));
    console.log(this.password)
    console.log(this.username)
    console.log("OTP---"+ this.code)
}

I am trying to reset the password.After collection of OTP in email, input the new password and press submit cognito show:

{code: "SerializationException", name: "SerializationException", message: "class com.amazon.coral.value.json.numbers.TruncatingBigNumber can not be converted to an String"}

Can someone plz help me?

1 Answers

I had the same issue while confirming password, the issue was i was sending verification code as number, when i converted it into string it worked

Related