Closed AngeloStavrow closed 3 years ago
I've also seen similar false-positive logouts, where it looks like you've logged out, but lo and behold, you get stuck in a weird pseud-logged-out state. I suspect it may be related to writeas/writefreely-swift#25 — i.e., silent failures on some of the API responses.
This is a bit of a weird bug: when it happens, the app appears to get a valid access token from the server, but when it proceeds with fetching user content from the server after logout, those requests come back with a 401: Unauthorized
. I've confirmed that the access token is indeed invalidated by the server, but no DELETE
request appears to have been sent to /api/auth/me
to do so.
The PR in #124 to fix this therefore applies a defensive fix, checking for a valid token when requesting user content.
Sometimes, logging in to the app appears successful from the settings screen, but in fact it fails silently, with no content getting pulled in from the server.
The workaround is to "logout" and then log back in.