From e8669f693c6adbb33f515d9a4ce9d1079756e2e8 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Tue, 16 Jul 2019 14:09:38 +0700 Subject: CLOUD: Update BaseStorage to expect no refresh_token While refreshing access_token, some cloud providers also pass a new refresh_token. Google Drive does not, and accepts the same refresh_token next time. These changes allow this to happen. --- backends/cloud/box/boxstorage.cpp | 2 ++ backends/cloud/box/boxstorage.h | 2 ++ 2 files changed, 4 insertions(+) (limited to 'backends/cloud/box') diff --git a/backends/cloud/box/boxstorage.cpp b/backends/cloud/box/boxstorage.cpp index 42e902902d..f76fa3ac23 100644 --- a/backends/cloud/box/boxstorage.cpp +++ b/backends/cloud/box/boxstorage.cpp @@ -57,6 +57,8 @@ uint32 BoxStorage::storageIndex() { return kStorageBoxId; } bool BoxStorage::needsRefreshToken() { return true; } +bool BoxStorage::canReuseRefreshToken() { return false; } + void BoxStorage::saveConfig(Common::String keyPrefix) { ConfMan.set(keyPrefix + "access_token", _token, ConfMan.kCloudDomain); ConfMan.set(keyPrefix + "refresh_token", _refreshToken, ConfMan.kCloudDomain); diff --git a/backends/cloud/box/boxstorage.h b/backends/cloud/box/boxstorage.h index a6ceb522ad..a8fd32c404 100644 --- a/backends/cloud/box/boxstorage.h +++ b/backends/cloud/box/boxstorage.h @@ -51,6 +51,8 @@ protected: virtual bool needsRefreshToken(); + virtual bool canReuseRefreshToken(); + public: /** This constructor uses OAuth code flow to get tokens. */ BoxStorage(Common::String code); -- cgit v1.2.3