Tokens bug resolved, login error handled
This commit is contained in:
parent
cdde0b9e2e
commit
7b2b5f5284
@ -73,16 +73,16 @@ API::RequestId API::sendLogin (const QString& login, const QString& password, co
|
|||||||
log.get(),
|
log.get(),
|
||||||
&Request::Login::success,
|
&Request::Login::success,
|
||||||
this,
|
this,
|
||||||
[this, &finished] (const QVariantMap& data) {
|
[this, finished] (const QVariantMap& data) {
|
||||||
callCallback(finished, QString(), {QJSValue(true)});
|
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(
|
connect(
|
||||||
log.get(),
|
log.get(),
|
||||||
&Request::Login::error,
|
&Request::Login::error,
|
||||||
this,
|
this,
|
||||||
[this, &finished] (const QString& error) {
|
[this, finished] (const QString& error) {
|
||||||
callCallback(finished, error, {QJSValue(false)});
|
callCallback(finished, error, {QJSValue(false)});
|
||||||
magpie.setState(Models::Magpie::NotAuthenticated);
|
magpie.setState(Models::Magpie::NotAuthenticated);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user