]> git.openstreetmap.org Git - rails.git/commitdiff
use api.openstreetmap.org for API calls when running on www.osm.org
authorMartin Raifer <martin@raifer.tech>
Wed, 8 Nov 2023 11:41:30 +0000 (12:41 +0100)
committerMartin Raifer <martin@raifer.tech>
Wed, 8 Nov 2023 11:52:23 +0000 (12:52 +0100)
see https://github.com/openstreetmap/operations/issues/951

app/assets/javascripts/id.js

index 2d0d01a6fd1198e7e97ad9b008af2a92b3c3aa0b..8c0a061ddc01bfc2333e6ad993965aad43fe0077 100644 (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
     });