mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-21 20:27:45 +00:00
Display the actual login error message when a login failure occurs
Apparently Square Enix provides a human-readable error message, so now we give that out in the message box instead of a generic "password is incorrect" message we did before.
This commit is contained in:
parent
0dd708096f
commit
65d46aa5c9
1 changed files with 9 additions and 1 deletions
|
@ -143,7 +143,15 @@ void SquareLauncher::login(const LoginInformation& info, const QUrl referer) {
|
||||||
|
|
||||||
registerSession(info);
|
registerSession(info);
|
||||||
} else {
|
} else {
|
||||||
auto messageBox = new QMessageBox(QMessageBox::Icon::Critical, "Failed to Login", "Invalid username/password.");
|
QRegularExpression re(R"lit(window.external.user\("login=auth,ng,err,(?<launchParams>.*)\);)lit");
|
||||||
|
QRegularExpressionMatch match = re.match(str);
|
||||||
|
|
||||||
|
const auto parts = match.captured(1).split(',');
|
||||||
|
|
||||||
|
// there's a stray quote at the end of the error string, so let's remove that
|
||||||
|
QString errorStr = match.captured(1).chopped(1);
|
||||||
|
|
||||||
|
auto messageBox = new QMessageBox(QMessageBox::Icon::Critical, "Failed to Login", errorStr);
|
||||||
messageBox->show();
|
messageBox->show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue