From 1e75988ce012c835ed6b6e9de32cd92fc6794338 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 23 Feb 2021 07:24:59 +0100 Subject: [PATCH] debug oauth --- src/librssguard/network-web/oauthhttphandler.cpp | 6 +++--- .../services/feedly/gui/formeditfeedlyaccount.cpp | 4 ++-- src/librssguard/services/gmail/gui/formeditgmailaccount.cpp | 4 ++-- .../services/inoreader/gui/formeditinoreaderaccount.cpp | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/librssguard/network-web/oauthhttphandler.cpp b/src/librssguard/network-web/oauthhttphandler.cpp index 15485e76a..3bf40cf7f 100644 --- a/src/librssguard/network-web/oauthhttphandler.cpp +++ b/src/librssguard/network-web/oauthhttphandler.cpp @@ -41,7 +41,7 @@ void OAuthHttpHandler::setListenAddressPort(const QString& full_uri) { listen_address = QHostAddress(url.host()); } - if (listen_address == m_listenAddress && url.port() == m_listenPort && m_httpServer.isListening()) { + if (listen_address == m_listenAddress && listen_port == m_listenPort && m_httpServer.isListening()) { // NOTE: We do not need to change listener's settings or re-start it. return; } @@ -54,9 +54,9 @@ void OAuthHttpHandler::setListenAddressPort(const QString& full_uri) { if (!m_httpServer.listen(listen_address, listen_port)) { qCriticalNN << LOGSEC_OAUTH << "OAuth redirect handler FAILED TO START TO LISTEN on address" - << QUOTE_W_SPACE(m_listenAddress.toString()) + << QUOTE_W_SPACE(listen_address.toString()) << "and port" - << QUOTE_W_SPACE_DOT(m_listenPort); + << QUOTE_W_SPACE_DOT(listen_port); } else { m_listenAddress = listen_address; diff --git a/src/librssguard/services/feedly/gui/formeditfeedlyaccount.cpp b/src/librssguard/services/feedly/gui/formeditfeedlyaccount.cpp index def54e2dd..2d83a9a0c 100755 --- a/src/librssguard/services/feedly/gui/formeditfeedlyaccount.cpp +++ b/src/librssguard/services/feedly/gui/formeditfeedlyaccount.cpp @@ -33,7 +33,7 @@ void FormEditFeedlyAccount::apply() { account()->network()->oauth()->setAccessToken(m_details->m_oauth->accessToken()); account()->network()->oauth()->setRefreshToken(m_details->m_oauth->refreshToken()); account()->network()->oauth()->setTokensExpireIn(m_details->m_oauth->tokensExpireIn()); - m_details->m_oauth->logout(); + m_details->m_oauth->logout(true); m_details->m_oauth->deleteLater(); // Force live OAuth object to re-start it's redirection handler. @@ -63,7 +63,7 @@ void FormEditFeedlyAccount::setEditableAccount(ServiceRoot* editable_account) { #if defined (FEEDLY_OFFICIAL_SUPPORT) if (m_details->m_oauth != nullptr) { // We will use live OAuth service for testing. - m_details->m_oauth->logout(); + m_details->m_oauth->logout(true); m_details->m_oauth->deleteLater(); } diff --git a/src/librssguard/services/gmail/gui/formeditgmailaccount.cpp b/src/librssguard/services/gmail/gui/formeditgmailaccount.cpp index bd9c3cf25..7fdd54528 100644 --- a/src/librssguard/services/gmail/gui/formeditgmailaccount.cpp +++ b/src/librssguard/services/gmail/gui/formeditgmailaccount.cpp @@ -28,7 +28,7 @@ void FormEditGmailAccount::apply() { account()->network()->oauth()->setRefreshToken(m_details->m_oauth->refreshToken()); account()->network()->oauth()->setAccessToken(m_details->m_oauth->accessToken()); account()->network()->oauth()->setTokensExpireIn(m_details->m_oauth->tokensExpireIn()); - m_details->m_oauth->logout(); + m_details->m_oauth->logout(true); m_details->m_oauth->deleteLater(); } @@ -53,7 +53,7 @@ void FormEditGmailAccount::setEditableAccount(ServiceRoot* editable_account) { if (m_details->m_oauth != nullptr) { // We will use live OAuth service for testing. - m_details->m_oauth->logout(); + m_details->m_oauth->logout(true); m_details->m_oauth->deleteLater(); } diff --git a/src/librssguard/services/inoreader/gui/formeditinoreaderaccount.cpp b/src/librssguard/services/inoreader/gui/formeditinoreaderaccount.cpp index 23f8db013..6272dc20e 100644 --- a/src/librssguard/services/inoreader/gui/formeditinoreaderaccount.cpp +++ b/src/librssguard/services/inoreader/gui/formeditinoreaderaccount.cpp @@ -54,8 +54,9 @@ void FormEditInoreaderAccount::setEditableAccount(ServiceRoot* editable_account) if (m_details->m_oauth != nullptr) { // We will use live OAuth service for testing. - m_details->m_oauth->logout(); - m_details->m_oauth->deleteLater(); + m_details->m_oauth->logout(true); + delete m_details->m_oauth; + m_details->m_oauth = nullptr; } m_details->m_oauth = account()->network()->oauth();