AngularJS recreate last api call

60 views Asked by At

I am working on an AnjularJS project with Token authentication and Refresh token.

In some case when i am submit a form and make the api call, i get 401 in which the Token has expired and automatic refresh the token. Which works just fine.

The issue i am having is, after it refresh the token i want to automatic make the api call to resubmit the form.

Do i have to create a service to keep track of all calls? Does angular keep track of all calls?

Any ideas on how to do this.

Thanks

1

There are 1 answers

0
Valter On BEST ANSWER

I used the following module that create a buffer of all the state and then i just have to recreate all the api call in the buffer.

I used https://github.com/witoldsz/angular-http-auth