hurt-tomatoH
Refine3y ago
7 replies
hurt-tomato

Invalidate login when API authentication expires?

I'm trying to log a user out, and send them to the login page, if our API responds to say the session is invalid.

As an example, a login session is invalidated if someone logs in with the same account on a different browser/device.

Our API will start responding with a 401.

I can get the 401 via an axios interceptor. How can I kick the "check" login functionality at this point, to then handle the redirect to login?
Was this page helpful?