diff options
author | aunsane <aunsane@gmail.com> | 2017-04-23 23:07:03 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-04-23 23:14:45 +0300 |
commit | 856629d0e757c73720097fd89d598c097df86c2b (patch) | |
tree | 716255c90dda5538f367d464f0dbbc968b55c3a5 /plugins/CloudFile/src/Services/yandex_api.h | |
parent | 71a8d5202cc65a6e714956e78852a7b87ce51b35 (diff) |
CloudFile: fix for token refresh
Diffstat (limited to 'plugins/CloudFile/src/Services/yandex_api.h')
-rw-r--r-- | plugins/CloudFile/src/Services/yandex_api.h | 15 |
1 files changed, 15 insertions, 0 deletions
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: |