When an unrecoverable authentication error occurs, automatically log
the user out. This seems better than leaving the user wondering why
the UI is unresponsive or why each track they try to play fails with a
quickly disappearing toast.
Unrecoverable authentication errors typically mean the server has
timed out the session out or the session token has been deleted on the
server. Tokens expire after 14 days without use.
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale-android/-/merge_requests/342>
Most of this was added to debug issue !102. So these are vestigial.
The exception here is the handling of AuthorizationException type 2.
These are produced by racing authentication requests and are
successfully managed. So we need not report these.
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale-android/-/merge_requests/342>
Migrate startActivityForResult/onActivityResult to
StartActivityForResult/registerForActivityResult in
LoginActivity/OAuth.
This moves responsibility for scheduling the starting Intent from
OAuth to LoginActivity.
OAuth still generates the Intent. But instead of starting the intent
directly in OAuth, the intent is returned to LoginActivity. This
better associates processing the activity result with its invocation.
OAuthTest module updated to accommodate internal API change.