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(),
|
||||
&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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user