SpinTheMic
Pro

Interview practice question

Handling expired access tokens during API calls

Frontend Engineering · State Management and Data Fetching · Intermediate

API calls fail with 401 when access tokens expire, and users get logged out unexpectedly. How would you handle token refresh?

What a strong answer covers

Your AI report card counts how many of these ideas you cover.

  • Intercept 401; refresh once.
  • Queue concurrent requests during refresh.
  • Retry original requests.
  • Logout if refresh fails.
  • Prefer HttpOnly cookie refresh tokens.
Practise this topic

Start without signing up. Sign in free to get an AI report card on your answer.

See all topics