debug oauth

This commit is contained in:
Martin Rotter 2021-02-23 07:30:38 +01:00
parent 1e75988ce0
commit 2795412454
3 changed files with 9 additions and 0 deletions

View File

@ -72,6 +72,10 @@ OAuth2Service::OAuth2Service(const QString& auth_url, const QString& token_url,
});
}
OAuth2Service::~OAuth2Service() {
qDebugNN << LOGSEC_OAUTH << "Destroying OAuth2Service instance.";
}
QString OAuth2Service::bearer() {
if (!isFullyLoggedIn()) {
qApp->showGuiMessage(tr("You have to login first"),

View File

@ -38,6 +38,7 @@ class OAuth2Service : public QObject {
explicit OAuth2Service(const QString& auth_url, const QString& token_url,
const QString& client_id, const QString& client_secret,
const QString& scope, QObject* parent = nullptr);
virtual ~OAuth2Service();
// Returns bearer HTTP header value.
// NOTE: If on working thread, then call this only if isFullyLoggedIn()

View File

@ -12,6 +12,8 @@
#include "services/inoreader/inoreaderserviceroot.h"
#include "services/inoreader/network/inoreadernetworkfactory.h"
#include <QThread>
FormEditInoreaderAccount::FormEditInoreaderAccount(QWidget* parent)
: FormAccountDetails(qApp->icons()->miscIcon(QSL("inoreader")), parent), m_details(new InoreaderAccountDetails(this)) {
insertCustomTab(m_details, tr("Server setup"), 0);
@ -31,6 +33,8 @@ void FormEditInoreaderAccount::apply() {
account<InoreaderServiceRoot>()->network()->oauth()->setTokensExpireIn(m_details->m_oauth->tokensExpireIn());
m_details->m_oauth->logout(true);
m_details->m_oauth->deleteLater();
QThread::currentThread()->msleep(300);
}
account<InoreaderServiceRoot>()->network()->oauth()->setClientId(m_details->m_ui.m_txtAppId->lineEdit()->text());