mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
feat: Move VATSIM auth endpoint URL to bootstrap.json
This commit is contained in:
@@ -44,5 +44,8 @@
|
|||||||
},
|
},
|
||||||
"afvMapUrl": {
|
"afvMapUrl": {
|
||||||
"url": "https://afv-map.vatsim.net/"
|
"url": "https://afv-map.vatsim.net/"
|
||||||
|
},
|
||||||
|
"vatsimAuthUrl": {
|
||||||
|
"url": "https://auth.vatsim.net/api/fsd-jwt"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,6 +142,9 @@ namespace BlackCore::Data
|
|||||||
//! AFV map URL
|
//! AFV map URL
|
||||||
BlackMisc::Network::CUrl getAfvMapUrl() const { return m_afvMapUrl; }
|
BlackMisc::Network::CUrl getAfvMapUrl() const { return m_afvMapUrl; }
|
||||||
|
|
||||||
|
//! VATSIM auth URL
|
||||||
|
BlackMisc::Network::CUrl getVatsimAuthUrl() const { return m_vatsimAuthUrl; }
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||||
QString convertToQString(bool i18n = false) const;
|
QString convertToQString(bool i18n = false) const;
|
||||||
|
|
||||||
@@ -177,6 +180,7 @@ namespace BlackCore::Data
|
|||||||
BlackMisc::Network::CUrl m_ssrEquipmentHelpUrl; //!< Help URL for SSR equipment codes
|
BlackMisc::Network::CUrl m_ssrEquipmentHelpUrl; //!< Help URL for SSR equipment codes
|
||||||
BlackMisc::Network::CUrl m_afvApiServerUrl; //!< AFV API server URL
|
BlackMisc::Network::CUrl m_afvApiServerUrl; //!< AFV API server URL
|
||||||
BlackMisc::Network::CUrl m_afvMapUrl; //!< AFV map URL
|
BlackMisc::Network::CUrl m_afvMapUrl; //!< AFV map URL
|
||||||
|
BlackMisc::Network::CUrl m_vatsimAuthUrl; //!< VATSIM Auth URL
|
||||||
bool m_dbDebugFlag = false; //!< can trigger DEBUG on the server, so you need to know what you are doing. Only works with CBuildConfig::isLocalDeveloperDebugBuild
|
bool m_dbDebugFlag = false; //!< can trigger DEBUG on the server, so you need to know what you are doing. Only works with CBuildConfig::isLocalDeveloperDebugBuild
|
||||||
|
|
||||||
BLACK_METACLASS(
|
BLACK_METACLASS(
|
||||||
@@ -197,7 +201,8 @@ namespace BlackCore::Data
|
|||||||
BLACK_METAMEMBER(ssrEquipmentHelpUrl, 0, RequiredForJson),
|
BLACK_METAMEMBER(ssrEquipmentHelpUrl, 0, RequiredForJson),
|
||||||
BLACK_METAMEMBER(dbDebugFlag, 0, RequiredForJson),
|
BLACK_METAMEMBER(dbDebugFlag, 0, RequiredForJson),
|
||||||
BLACK_METAMEMBER(afvApiServerUrl, 0, RequiredForJson),
|
BLACK_METAMEMBER(afvApiServerUrl, 0, RequiredForJson),
|
||||||
BLACK_METAMEMBER(afvMapUrl, 0, RequiredForJson)
|
BLACK_METAMEMBER(afvMapUrl, 0, RequiredForJson),
|
||||||
|
BLACK_METAMEMBER(vatsimAuthUrl, 0, RequiredForJson)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -1016,7 +1016,8 @@ namespace BlackCore::Fsd
|
|||||||
|
|
||||||
void CFSDClient::getVatsimAuthToken(const QString &cid, const QString &password, const BlackMisc::CSlot<void(const QString &)> &callback)
|
void CFSDClient::getVatsimAuthToken(const QString &cid, const QString &password, const BlackMisc::CSlot<void(const QString &)> &callback)
|
||||||
{
|
{
|
||||||
QNetworkRequest nwRequest(QUrl("https://auth.vatsim.net/api/fsd-jwt"));
|
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Need app");
|
||||||
|
QNetworkRequest nwRequest(sApp->getGlobalSetup().getVatsimAuthUrl());
|
||||||
nwRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
nwRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
|
||||||
const QJsonObject jsonRequest { { "cid", cid }, { "password", password } };
|
const QJsonObject jsonRequest { { "cid", cid }, { "password", password } };
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user