I am using @Chime-sdk and @Angular-12 using AWS STS token, which one will expired after 15 minutes. After Expired STS token AWS call refresh method so I used refresh() method to call my back-end api for new token then I re-assign all credentials, till now it's working good.
But it can't retry last api or request after completed refresh method execution. below attached my code:
this._aws.credentials.refresh = (() => {
this.exampleApiService.getToken().toPromise()
.then((response: any) => {
this._aws.credentials.accessKeyId = response.accessKeyId;
this._aws.credentials.secretAccessKey = response.secretAccessKey
this._aws.credentials.sessionToken = response.sessionToken;
this._aws.credentials.expireTime = response.expireTime;
this._aws.credentials.expired = false;
this.setChimeClient();
}).catch(error => {
console.log(error)
});
})
So How can i retry or recall my last last api call or request ?