All jobs / Frontend / web developer / Security

Frontend / web developer interview question · 3–5 years

Two 401s trigger two refresh calls and one of them logs the user out. How do you design the client?

The strongest answer

Single-flight the refresh, queue the original requests, retry them, and log out only when refresh fails

Why it works

Refresh is a critical section. One in-flight refresh, everyone else waits.

What a good answer covers

Answers that fall short

Who gets asked this

More Security questions