Tokens bug resolved, login error handled

This commit is contained in:
Blue 2024-07-07 17:55:25 -03:00
parent cdde0b9e2e
commit 7b2b5f5284
Signed by: blue
GPG Key ID: 9B203B252A63EE38

View File

@ -73,16 +73,16 @@ API::RequestId API::sendLogin (const QString& login, const QString& password, co
log.get(),
&Request::Login::success,
this,
[this, &finished] (const QVariantMap& data) {
[this, finished] (const QVariantMap& data) {
callCallback(finished, QString(), {QJSValue(true)});
magpie.setTokens(data.value("accessToken").toString(), data.value("renewToken").toString());
magpie.setTokens(data.value("accessToken").toString(), data.value("renewToken").toString(), true);
}
);
connect(
log.get(),
&Request::Login::error,
this,
[this, &finished] (const QString& error) {
[this, finished] (const QString& error) {
callCallback(finished, error, {QJSValue(false)});
magpie.setState(Models::Magpie::NotAuthenticated);
}