use api.openstreetmap.org for API calls when running on www.osm.org

see https://github.com/openstreetmap/operations/issues/951
This commit is contained in:
Martin Raifer 2023-11-08 12:41:30 +01:00
parent 5c5695d9c1
commit b834bd70d0
No known key found for this signature in database
GPG key ID: 3CD561F7B1C461BD

View file

@ -13,8 +13,10 @@ document.addEventListener("DOMContentLoaded", function () {
} else {
var idContext = iD.coreContext();
idContext.connection().apiConnections([]);
var url = location.protocol + "//" + location.host;
idContext.preauth({
url: location.protocol + "//" + location.host,
url: url,
apiUrl: url === "https://www.openstreetmap.org" ? "https://api.openstreetmap.org" : url,
access_token: container.dataset.token
});