【发布时间】:2020-09-06 10:33:50
【问题描述】:
所以,我尝试使用 amplify 中的 forgotPasswordSubmit 重置密码,我将先前询问的安全代码作为参数传递,该安全代码发送到电子邮件和两次新密码,当我发送值时,我在控制台:
ERROR Error: Uncaught (in promise): Object: {"code":"SerializationException","name":"SerializationException","message":"class com.amazon.coral.value.json.numbers.TruncatingBigNumber can not be converted to an String"}
at resolvePromise (zone-evergreen.js:798)
at resolvePromise (zone-evergreen.js:750)
at zone-evergreen.js:860
at ZoneDelegate.invokeTask (zone-evergreen.js:399)
at Object.onInvokeTask (core.js:41264)
at ZoneDelegate.invokeTask (zone-evergreen.js:398)
at Zone.runTask (zone-evergreen.js:167)
at drainMicroTaskQueue (zone-evergreen.js:569)
这是我的html代码:
<div *ngIf="newPassword">
<form [formGroup]="passwordForm"(ngSubmit)="verifyPassword(passwordForm.value)">
<class="form-group">
<label for="">Código</label>
<input type="number" class="form-control" id="exampleInputverifycode1" #verifycode formControlName = "code" placeholder="Ingresa el código">
</div>
<div>
<label for="">Contraseña</label>
<input type="password" name="password" id="exampleInputverifycode1" #verifycode formControlName = "password" placeholder="Ingresa tu contraseña">
</div>
<div>
<label for="">Contraseña</label>
<input type="password" name="password" id="exampleInputverifycode1" #verifycode formControlName = "passwordRepeat" placeholder="vuelve a escribir tu contraseña">
</div>
<div class="modal-footer">
<button role="button" class="btn btn-forms-submit w-100" >Aceptar</button>
</div>
</form>
这是验证通过表单给出的值的代码:
passwordForm = new FormGroup({
code: new FormControl('', [Validators.required]),
password: new FormControl('',[Validators.required]),
passwordRepeat: new FormControl('',[Validators.required])
})
verifyPassword(value){
console.log(value);
Auth.forgotPasswordSubmit(value.code,value.password, value.passwordRepeat)
.then(data=> console.log(data)
)
}
【问题讨论】:
-
看起来您的同一个 id (
exampleInputverifycode1) 被使用了 3 次,可能值得确保这不是复合问题。
标签: angular amazon-web-services amazon-cognito aws-amplify