Skip to content

Commit

Permalink
VIC-12720 Update CBLAuthDelegate for v1.11 timeout fix (#3)
Browse files Browse the repository at this point in the history
There are user reports of alexa automatically signing out when not in use.
A possibly relevant sdk issue, alexa#1106, identified an issue with the timeout in
the CBLAuthDelegate. This cherrypicks that fix.
  • Loading branch information
rosspanderson authored Feb 14, 2019
1 parent 30e278a commit 49fefa8
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,12 @@ avsCommon::utils::libcurlUtils::HTTPResponse CBLAuthDelegate::requestRefresh() {
auto timeout = m_configuration->getRequestTimeout();
if (AuthObserverInterface::State::REFRESHED == m_authState) {
auto timeUntilExpired = std::chrono::duration_cast<std::chrono::seconds>(m_tokenExpirationTime - m_requestTime);
if (timeout > timeUntilExpired) {
if ((timeout > timeUntilExpired) && (timeUntilExpired > std::chrono::seconds::zero())) {
timeout = timeUntilExpired;
}
}

return m_httpPost->doPost(
m_configuration->getRequestTokenUrl(), headerLines, postData, m_configuration->getRequestTimeout());
return m_httpPost->doPost(m_configuration->getRequestTokenUrl(), headerLines, postData, timeout);
}

AuthObserverInterface::Error CBLAuthDelegate::receiveCodePairResponse(const HTTPResponse& response) {
Expand Down

0 comments on commit 49fefa8

Please sign in to comment.