mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
change(MSAStep): log server errors
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
70cbbf5b07
commit
665aa4c546
1 changed files with 28 additions and 1 deletions
|
|
@ -81,6 +81,33 @@ class CustomOAuthOobReplyHandler : public QOAuthOobReplyHandler {
|
|||
disconnect(APPLICATION, &Application::oauthReplyRecieved, this, &QOAuthOobReplyHandler::callbackReceived);
|
||||
}
|
||||
QString callback() const override { return BuildConfig.LAUNCHER_APP_BINARY_NAME + "://oauth/microsoft"; }
|
||||
|
||||
protected:
|
||||
void networkReplyFinished(QNetworkReply* reply) override
|
||||
{
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
qWarning() << "OAuth2 request failed:" << reply->readAll();
|
||||
}
|
||||
|
||||
QOAuthOobReplyHandler::networkReplyFinished(reply);
|
||||
}
|
||||
};
|
||||
|
||||
class LoggingOAuthHttpServerReplyHandler final : public QOAuthHttpServerReplyHandler {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LoggingOAuthHttpServerReplyHandler(QObject* parent = nullptr) : QOAuthHttpServerReplyHandler(parent) {}
|
||||
|
||||
protected:
|
||||
void networkReplyFinished(QNetworkReply* reply) override
|
||||
{
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
qWarning() << "OAuth2 request failed:" << reply->readAll();
|
||||
}
|
||||
|
||||
QOAuthHttpServerReplyHandler::networkReplyFinished(reply);
|
||||
}
|
||||
};
|
||||
|
||||
MSAStep::MSAStep(AccountData* data, bool silent) : AuthStep(data), m_silent(silent)
|
||||
|
|
@ -89,7 +116,7 @@ MSAStep::MSAStep(AccountData* data, bool silent) : AuthStep(data), m_silent(sile
|
|||
if (QCoreApplication::applicationFilePath().startsWith("/tmp/.mount_") || APPLICATION->isPortable() || !isSchemeHandlerRegistered())
|
||||
|
||||
{
|
||||
auto replyHandler = new QOAuthHttpServerReplyHandler(this);
|
||||
auto replyHandler = new LoggingOAuthHttpServerReplyHandler(this);
|
||||
replyHandler->setCallbackText(QString(R"XXX(
|
||||
<noscript>
|
||||
<meta http-equiv="Refresh" content="0; URL=%1" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue