CLOUD: Update Dropbox to use refresh_token #2715
Dropbox is switching to short-lived
@Mataniko already added a new endpoint on cloud.scummvm.org, which will be used for Dropbox from now on. Older versions of ScummVM, which do not have this change, will still work with "Legacy" endpoint until Dropbox deprecates it.
I've checked all the
Dropbox is switching to short-lived access_token OAuth. This commit adapts Cloud::DropboxStorage to use refresh_token similarly to how other Storages do: by introducing a DropboxTokenRefresher. It is used instead of plain CurlJsonRequest. It just checks if received JSON has access_token-related error and tries to refresh it, then repeats the original request transparently for the caller. If no such errors found, it just passes the info to the caller.