diff --git a/launcher/minecraft/auth/steps/MSAStep.cpp b/launcher/minecraft/auth/steps/MSAStep.cpp index 62066b572..665070bd3 100644 --- a/launcher/minecraft/auth/steps/MSAStep.cpp +++ b/launcher/minecraft/auth/steps/MSAStep.cpp @@ -124,11 +124,16 @@ MSAStep::MSAStep(AccountData* data, bool silent) : AuthStep(data), m_silent(sile if (oauth2.status() == QAbstractOAuth::Status::Granted || silent) { state = AccountTaskState::STATE_FAILED_SOFT; } - emit finished(state, tr("Microsoft user authentication failed.")); + auto message = tr("Microsoft user authentication failed."); + if (silent) { + message = tr("Failed to refresh token."); + } + qWarning() << message; + emit finished(state, message); }); connect(&oauth2, &QOAuth2AuthorizationCodeFlow::error, this, [this](const QString& error, const QString& errorDescription, const QUrl& uri) { - qDebug() << "Failed to login because" << error << errorDescription; + qWarning() << "Failed to login because" << error << errorDescription; emit finished(AccountTaskState::STATE_FAILED_HARD, errorDescription); }); @@ -152,6 +157,10 @@ void MSAStep::perform() tr("Microsoft user authentication failed - client identification has changed.")); return; } + if (m_data->msaToken.refresh_token.isEmpty()) { + emit finished(AccountTaskState::STATE_DISABLED, tr("Microsoft user authentication failed - refresh token is empty.")); + return; + } oauth2.setRefreshToken(m_data->msaToken.refresh_token); oauth2.refreshAccessToken(); } else {