OpenArchive / Save-app-android-old

This is the Save app for Android
https://open-archive.org
GNU General Public License v3.0
96 stars 25 forks source link

Backend session expiry #575

Open ryjen opened 8 months ago

ryjen commented 8 months ago

Describe the bug Authentication with backends provides a session token that may expire after a certain time for security.

There is no current method of reauthenticating other than deleting and re-adding.

This is a common use-case amongst authentication services that generally have an API to call to 'refresh' a token.

To Reproduce Steps to reproduce the behavior:

  1. Add a backend
  2. Wait a few days/weeks
  3. Use backend
  4. See error

Expected behavior The application should refresh the session automatically, or the user should be prompted to add their credentials again.

Screenshots 305413602-7489eee1-0406-44e6-83c0-9131162507bf

Environment (please complete the following information):

Additional context Any user error message strings need to be localized.

tladesignz commented 8 months ago

Actually, I'm confused, that this error happens at all. Resp. I'm confused about if this error actually means what we think it means. One would expect that the Dropbox library would handle all of this on its own.

Maybe there's just some func in the Android library we need to call in this case? Or, like every time the user starts the app to make sure access tokens are refreshed?

As a remedy the user can do, we should probably provide a "Reauthenticate" button in the Dropbox settings scene, which currently just shows the user ID and which triggers the authentication process again.

Maybe, we can even ask the Dropbox lib, if the session is good or broken. Only in the latter case, we would show the button.

If there's a function like that in the Dropbox lib, we could also check before a new upload starts.