How to detect if the current user’s session has expired inside of a ReactJS app, specifically within an Axios request interceptor.
The recommended approach in this case would be to make use of the
getAccessTokenSilently() is called and if the user’s session has already expired, the login_required error is thrown, and the user is presented with the login prompt to authenticate themselves again. If the user’s session is valid/not expired, the
getAccessTokenSilently() extends the user session without any error/prompt.