witoldsz / angular-http-auth

MIT License
2.38k stars 418 forks source link

Scenario with refresh token (e.g. authService.ignoreCurrentRequest()) #135

Closed djleonskennedy closed 8 years ago

djleonskennedy commented 8 years ago

Hello I have scenario :

access_token : expires 15 min refresh_token : expires 1 day

1) login -> "access_token" and "refresh_token" 2) after 15 min "access_token" expiration date ends and i need to request refresh()

when i call refresh() after 1 day, interceptor capture refresh 401 too, and I can't handle ".then(error => error)"

Is it posible to specify "authService.ignoreCurrentRequest()" for example?

Thank you

AndriiDidkivsky commented 8 years ago

+

witoldsz commented 8 years ago

Yes, ignoring specific requests by this module is possible. See the "Ignoring the 401 interceptor" section of Readme: https://github.com/witoldsz/angular-http-auth#ignoring-the-401-interceptor

Hope that helps your case.

djleonskennedy commented 8 years ago

I have to read documentation more attentively in future, it works well, thank you