Rest api integration, how to handle token expiry (401 interceptor)

Hi have implemented custom authentication (auth0)

I can successfully store the token in app variables and use it in headers when using restapi data (data tab)

Question is, at some point the token can be invalid and the restapi can return 401 unauthenticated response code. At those times i’d like to return back to initial screen and the user will have to login again.

What is the best way to do that?