Skip to content

Commit

Permalink
Trigger LoginFailed when site API itself returns an error on login
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 4, 2019
1 parent 80e9a79 commit edcb71a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Etterna/Singletons/DownloadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2222,6 +2222,13 @@ DownloadManager::StartSession(string user,
return;
}

// Site 404s when login fails
if (d.HasMember("errors") && d["errors"].IsArray()) {
DLMAN->authToken = DLMAN->sessionUser = DLMAN->sessionPass = "";
MESSAGEMAN->Broadcast("LoginFailed");
DLMAN->loggingIn = false;
}

if (d.HasMember("data") && d["data"].IsObject() &&
d["data"].HasMember("attributes") &&
d["data"]["attributes"].IsObject() &&
Expand Down

0 comments on commit edcb71a

Please sign in to comment.