A real-world situation reported by 박**
When the token of a user signed in with Chzzk OAuth expires, refresh it automatically so the request can continue. When a resource call returns 401 because the access token has expired, get a new token with the refresh token and call again. Complete request in api-client.ts. Note: the server calls (callResource, refreshTokens) and the token store (tokenStore) are already there. You only fill in request.
A problem where you complete, with Next.js (App Router) and TypeScript, the flow that keeps a signed-in user's session unbroken by fetching a fresh token when the old one stops working. When a resource call no longer goes through, you get a new token and call again — filled into request in api-client.
With short-lived tokens, a good experience is to quietly fetch a new token and carry the session on, rather than bouncing the user back to a login screen when the token stops working. This "unbroken session" shows up on almost every screen that uses token-based auth, and this problem implements that flow directly.