Handling JWT Authentication & Refresh Tokens in Angular Using an HTTP Interceptor
While working on authentication in Angular, one thing I found particularly useful was using an HTTP interceptor to handle authentication automatically. Instead of manually adding the access token to every API request, the interceptor can: Attach the JWT access token to outgoing requests Detect 401 Unauthorized responses Use the refresh token to obtain a new access token Retry the failed request…
We haven't written up this one. Dev.to has the full story — the link below goes straight to it.