ngx-auth
ngx-auth copied to clipboard
Refresh the token before making a new request
Hi,
Is it possible to check if it is needed to refresh the token before making a new request? As you know, there is an expires_at field where it is sometimes better to check it and refresh the token before making a request.
the flow when making a new request: 1- check expires_at 2- if expired, refresh and continue 3- make a request 4- if response is 401, refresh the token and retry
I believe it can be achieved with the hooks provided by the library.
Hi @serhiisol
Thanks for your response.