From 856629d0e757c73720097fd89d598c097df86c2b Mon Sep 17 00:00:00 2001 From: aunsane Date: Sun, 23 Apr 2017 23:07:03 +0300 Subject: CloudFile: fix for token refresh --- plugins/CloudFile/src/Services/yandex_api.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'plugins/CloudFile/src/Services/yandex_api.h') diff --git a/plugins/CloudFile/src/Services/yandex_api.h b/plugins/CloudFile/src/Services/yandex_api.h index f70964bc78..2a83abb634 100644 --- a/plugins/CloudFile/src/Services/yandex_api.h +++ b/plugins/CloudFile/src/Services/yandex_api.h @@ -24,6 +24,21 @@ namespace YandexAPI } }; + class RefreshTokenRequest : public HttpRequest + { + public: + RefreshTokenRequest(const char *refreshToken) : + HttpRequest(REQUEST_POST, YANDEX_OAUTH "/token") + { + AddHeader("Content-Type", "application/x-www-form-urlencoded"); + + CMStringA data(CMStringDataFormat::FORMAT, + "client_id=%s&client_secret=%s&grant_type=refresh_token&refresh_token=%s", + YANDEX_APP_ID, YADISK_CLIENT_SECRET, refreshToken); + SetData(data.GetBuffer(), data.GetLength()); + } + }; + class RevokeAccessTokenRequest : public HttpRequest { public: -- cgit v1.2.3