mirror of
https://github.com/PrismLauncher/PrismLauncher
synced 2026-04-23 09:05:03 +00:00
MSAStep: Log server errors (#4895)
This commit is contained in:
commit
b69dbc2224
|
|
@ -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…
Reference in a new issue