Maptio / maptio

http://www.maptio.com
Other
24 stars 5 forks source link

When token expiry causes API errors, prompt for relogin #855

Open rgoj opened 11 months ago

rgoj commented 11 months ago

Problem

In some cases, when you make a request to the API after your token expired, you will see weird errors rather than being prompted to log in again.

For example, you will see the Unable to create organisation ${name}! error when trying to create a new organisation.

Expected behavior

We should prompt the user to log in again.

Additional context

Here's the issue that raised this: https://app.intercom.com/a/apps/q3x5lnhp/inbox/inbox/conversation/106323200014887#part_id=comment-106323200014887-21895731033 (and that was such a hard one to debug, only managed to conclude this is what happened after seeing that there didn't seem to be any team creation requests from the correct IP in the correct time frame in the logs!)