Commit Graph

19 Commits

Author SHA1 Message Date
Hugh Daschbach 6f24535b79 Auto logout on unrecoverable authentication error.
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>
2024-02-22 18:15:04 +00:00
Hugh Daschbach 467556d75c Suppress some authentication noise in the log.
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>
2024-02-22 18:15:04 +00:00
Hugh Daschbach bea1d1f397
LoginActivity: startActivityForResult deprecated.
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.
2022-12-06 09:35:33 +01:00
Ryan Harg bfdac03d0c Upgrade to Kotlin 1.7.0 2022-08-26 12:06:41 +00:00
Ryan Harg 20ee27da21 fix authorization 2022-06-11 14:37:38 +00:00
Ryan Harg ef3387dee0
Fix existing linting problems 2021-09-09 09:56:15 +02:00
Ryan Harg 4f9f605bbf
Improving OAuth implementation 2021-08-27 11:06:46 +02:00
Ryan Harg 107a8d55e8
Refactor OAuth code 2021-08-23 09:17:06 +02:00
Ryan Harg 73631cc9e9 Further fix for refreshing access token 2021-08-22 07:13:19 +00:00
Ryan Harg fe4a00ae07 74: Update logging to gather more information 2021-08-13 08:56:00 +00:00
Ryan Harg 3aa37e5d3c
#80: Display error messages for user when login failes 2021-08-10 14:59:12 +02:00
Ryan Harg c997405906
#79: Add log statements in authentication code 2021-08-09 20:04:33 +02:00
Ryan Harg 80fc39a927
Remove OAuth interface 2021-08-09 08:40:04 +02:00
Ryan Harg a9319b88b0 #7: Add Koin as dependency injection library 2021-08-09 04:50:46 +00:00
Ryan Harg 09787c71f5 Update Android Gradle Plugin to 7.0.0 2021-08-04 08:41:42 +00:00
Ryan Harg 3a8b332796
#7: Unit tests for oauth authorization 2021-08-03 10:29:41 +02:00
Ryan Harg 2e35a313fc
#7: Add more tests to OAuth component 2021-08-02 13:24:12 +02:00
Ryan Harg e60d93a05a #7: Add unit tests to OAuthDatasource 2021-07-30 08:57:49 +00:00
Ryan Harg fcfc30a97e #48: Implement OAuth2 authentication 2021-07-23 12:10:13 +00:00