about the refreshtoken
zhouzhouwu opened this issue · 1 comments
great sample. helped a lot for greenhands.
a question:
regarding axios.interceptors.response, if the backend is not connected, this function would not be invoked, which means no TOKEN_EXPIERED would happen in front end. The user can still access other pages what need authentication.
is my comprehension correct?
No problem - hope it can help!
Well in the axios
interceptor - if the call fails in any way, then there are try/catch
blocks there where logoutOfProgram()
is called. You can see this on line 46 and 53.
In that way, if there is any error connecting to the backend during the token check, then it will error out and logout the user. So the user won't be able to see any pages that require authentication if there's no backend connected.
Thank you - let me know if you have any more questions.