From 60b807499bdb03bbcbb4dece6d665b97f54a2224 Mon Sep 17 00:00:00 2001 From: Prasenjit Kumar Shaw Date: Sat, 6 Jul 2019 19:51:15 +0530 Subject: [PATCH] Save Sync Credentials to settings --- src/lib/sync/fxalogin.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/sync/fxalogin.cpp b/src/lib/sync/fxalogin.cpp index a97222c2e..37497714f 100644 --- a/src/lib/sync/fxalogin.cpp +++ b/src/lib/sync/fxalogin.cpp @@ -20,6 +20,7 @@ #include "webpage.h" #include "communicator.h" #include "qztools.h" +#include "settings.h" #include #include @@ -90,6 +91,15 @@ void FxALoginPage::parseMessage(QJsonObject *msg) << " Key Fetch Token: " << key_fetch_token << '\n' << " unwrapBKey: " << unwrap_kb << '\n' << "=================================\n"; + + Settings settings; + settings.beginGroup(QSL("SyncCredentials")); + settings.setValue(QSL("Email"), email); + settings.setValue(QSL("UID"), uid); + settings.setValue(QSL("SessionToken"), session_token); + settings.setValue(QSL("KeyFetchToken"), key_fetch_token); + settings.setValue(QSL("UnwrapBKey"), unwrap_kb); + settings.endGroup(); } } @@ -102,4 +112,3 @@ void FxALoginPage::sendMessage(QJsonObject msg) QString srcCode = "sendMessage(" + stringMsg + ");"; m_page->runJavaScript(srcCode, WebPage::SafeJsWorld); } -