This is a bit of a workaround.
The problem is that we cache auth tokens, but that auth tokens can expire.
Thins means that we could have a stale auth token after coming back to
the app after a long time, so we need to fetch a new one.
Logging out is a bit of a nuclear option, but since this is a rare
scenario, it can do for now.
We were getting a 404 because the user info doesn't exist, and were erroring
because of it, which was not calling the then (just the catch).
We now handle the error condition.
This is extremely useful for iOS devices where a PWA's session storage
is deleted every time it's minimised, and it's also useful for people
having multiple tabs open.
We do this so we can persist the login info to local storage, but
still keep the encryption key safe.
This version will fails if you clear the session storage. This will be
fixed in the next commit.