summaryrefslogtreecommitdiff
path: root/src/organizercore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/organizercore.cpp')
-rw-r--r--src/organizercore.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index dff3485e..68ccd2ff 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -299,11 +299,13 @@ bool OrganizerCore::nexusApi(bool retry)
// previous attempt, maybe even successful
return false;
} else {
- QString apiKey;
- if (GlobalSettings::nexusApiKey(apiKey)) {
+ NexusOAuthTokens tokens;
+ GlobalSettings::nexusOAuthTokens(tokens);
+ GlobalSettings::nexusApiKey(tokens.apiKey);
+ if (tokens.isValid() || !tokens.apiKey.isEmpty()) {
// credentials stored or user entered them manually
- log::debug("attempt to verify nexus api key");
- accessManager->apiCheck(apiKey);
+ log::debug("attempt to verify nexus credentials");
+ accessManager->apiCheck(tokens);
return true;
} else {
// no credentials stored and user didn't enter them
@@ -1473,12 +1475,12 @@ void OrganizerCore::loggedInAction(QWidget* parent, std::function<void()> f)
if (NexusInterface::instance().getAccessManager()->validated()) {
f();
} else if (!m_Settings.network().offlineMode()) {
- QString apiKey;
- if (GlobalSettings::nexusApiKey(apiKey)) {
+ NexusOAuthTokens tokens;
+ if (GlobalSettings::nexusOAuthTokens(tokens)) {
doAfterLogin([f] {
f();
});
- NexusInterface::instance().getAccessManager()->apiCheck(apiKey);
+ NexusInterface::instance().getAccessManager()->apiCheck(tokens);
} else {
MessageDialog::showMessage(tr("You need to be logged in with Nexus"), parent);
}