forked from MapComplete/MapComplete
		
	Fix: fix tests; use OAuth client id from dedicated MapComplete account
This commit is contained in:
		
							parent
							
								
									752de107ab
								
							
						
					
					
						commit
						fc9dd46239
					
				
					 1 changed files with 10 additions and 3 deletions
				
			
		| 
						 | 
					@ -34,11 +34,18 @@ export type OsmServiceState = "online" | "readonly" | "offline" | "unknown" | "u
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export class OsmConnection {
 | 
					export class OsmConnection {
 | 
				
			||||||
    public static readonly oauth_configs: Record<string, AuthConfig> = {
 | 
					    public static readonly oauth_configs: Record<string, AuthConfig> = {
 | 
				
			||||||
        osm: {
 | 
					        osm_pietervdvn: {
 | 
				
			||||||
 | 
					            // This client_id is registered by "Pieter Vander Vennet" on OSM.org
 | 
				
			||||||
            oauth_client_id: 'sa1ngLJBJ8McmzHElN8NYtIDm5TZTYEYhq3-0snO4Qc',
 | 
					            oauth_client_id: 'sa1ngLJBJ8McmzHElN8NYtIDm5TZTYEYhq3-0snO4Qc',
 | 
				
			||||||
            oauth_secret: 'XU_cD5Mvw9VKk9T0t_gO8V7cbRC4Hmw2Tb4Rv0Zmz-U',
 | 
					            oauth_secret: 'XU_cD5Mvw9VKk9T0t_gO8V7cbRC4Hmw2Tb4Rv0Zmz-U',
 | 
				
			||||||
            url: "https://www.openstreetmap.org",
 | 
					            url: "https://www.openstreetmap.org",
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
 | 
					        osm: {
 | 
				
			||||||
 | 
					            // This client-id is registered by "MapComplete" on osm.org
 | 
				
			||||||
 | 
					            oauth_client_id: "K93H1d8ve7p-tVLE1ZwsQ4lAFLQk8INx5vfTLMu5DWk",
 | 
				
			||||||
 | 
					            oauth_secret: "NBWGhWDrD3QDB35xtVuxv4aExnmIt4FA_WgeLtwxasg",
 | 
				
			||||||
 | 
					            url: "https://www.openstreetmap.org",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
        "osm-test": {
 | 
					        "osm-test": {
 | 
				
			||||||
            oauth_client_id: "HwUn6GPxGm1m9WwMarxTglhy6dBTM4YkaV1I9h6pDGU",
 | 
					            oauth_client_id: "HwUn6GPxGm1m9WwMarxTglhy6dBTM4YkaV1I9h6pDGU",
 | 
				
			||||||
             oauth_secret: "luFZtPJg7j96K6WM6RpcZ_3M-r6muuDq6fG1ygk0I_4",
 | 
					             oauth_secret: "luFZtPJg7j96K6WM6RpcZ_3M-r6muuDq6fG1ygk0I_4",
 | 
				
			||||||
| 
						 | 
					@ -192,7 +199,7 @@ export class OsmConnection {
 | 
				
			||||||
        const self = this
 | 
					        const self = this
 | 
				
			||||||
        console.log("Trying to log in...")
 | 
					        console.log("Trying to log in...")
 | 
				
			||||||
        this.updateAuthObject()
 | 
					        this.updateAuthObject()
 | 
				
			||||||
        LocalStorageSource.Get("location_before_login").setData(window.location.href)
 | 
					        LocalStorageSource.Get("location_before_login").setData(Utils.runningFromConsole ? undefined : window.location.href)
 | 
				
			||||||
        this.auth.xhr(
 | 
					        this.auth.xhr(
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                method: "GET",
 | 
					                method: "GET",
 | 
				
			||||||
| 
						 | 
					@ -488,7 +495,7 @@ export class OsmConnection {
 | 
				
			||||||
            client_id: this._oauth_config.oauth_client_id,
 | 
					            client_id: this._oauth_config.oauth_client_id,
 | 
				
			||||||
            url: this._oauth_config.url,
 | 
					            url: this._oauth_config.url,
 | 
				
			||||||
            scope: "read_prefs write_prefs write_api write_gpx write_notes",
 | 
					            scope: "read_prefs write_prefs write_api write_gpx write_notes",
 | 
				
			||||||
            redirect_uri: window.location.protocol + "//" + window.location.host + "/land.html",
 | 
					            redirect_uri: Utils.runningFromConsole ? "https://mapcomplete.org/land.html" :  window.location.protocol + "//" + window.location.host + "/land.html",
 | 
				
			||||||
            singlepage: !standalone,
 | 
					            singlepage: !standalone,
 | 
				
			||||||
            auto: true,
 | 
					            auto: true,
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue