Skip to content

Commit ea0e40e

Browse files
Release/1.0 (#27)
* Update version to 1.0 release * Fixes decryption of refresh token.
1 parent f3d272b commit ea0e40e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

buildspec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"versionMinor": 0,
4343
"versionPatch": 0,
4444
"buildNumber": 0,
45-
"releaseType": "rc11",
45+
"releaseType": "release",
4646
"author": "Elgato",
4747
"website": "https://elgato.com",
4848
"email": "support@elgato.com",

src/elgato-cloud-data.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ void ElgatoCloud::_TokenRefresh(bool loadData, bool loadUserDetails)
136136
}
137137
return;
138138
}
139+
obs_log(LOG_INFO, "Access Token has expired. Fetching a new token.");
139140
auto api = MarketplaceApi::getInstance();
140141
std::string encodeddata;
141142
encodeddata += "grant_type=refresh_token";
@@ -149,6 +150,7 @@ void ElgatoCloud::_TokenRefresh(bool loadData, bool loadUserDetails)
149150
auto responseJson = nlohmann::json::parse(response);
150151
_ProcessLogin(responseJson, loadData);
151152
} catch (...) {
153+
obs_log(LOG_INFO, "There was a problem with the refresh token. Try logging in again.");
152154
loggedIn = false;
153155
loading = false;
154156
authorizing = false;
@@ -523,12 +525,14 @@ void ElgatoCloud::_GetSavedState()
523525
std::string refreshTokenEncrypted = obs_data_get_string(_config, "RefreshToken");
524526
if (accessTokenEncrypted.size() > 25) {
525527
_accessToken = decryptString(accessTokenEncrypted);
528+
_accessToken = _accessToken.substr(0, _accessToken.length() - 1);
526529
} else {
527530
_accessToken = "";
528531
}
529532

530533
if (refreshTokenEncrypted.size() > 25) {
531534
_refreshToken = decryptString(refreshTokenEncrypted);
535+
_refreshToken = _refreshToken.substr(0, _refreshToken.length() - 1);
532536
} else {
533537
_refreshToken = "";
534538
}

0 commit comments

Comments
 (0)