Use location for path
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				FarmMaps.Develop/FarmMapsLib/develop This commit looks good
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	FarmMaps.Develop/FarmMapsLib/develop This commit looks good
				
			This commit is contained in:
		@@ -1,4 +1,5 @@
 | 
			
		||||
import { Injector } from '@angular/core';
 | 
			
		||||
import { Location} from '@angular/common';
 | 
			
		||||
import { Router,UrlSerializer } from '@angular/router';
 | 
			
		||||
import { AuthConfig, OAuthService, JwksValidationHandler, OAuthErrorEvent  } from 'angular-oauth2-oidc';
 | 
			
		||||
import { AppConfig } from "./app.config";
 | 
			
		||||
@@ -26,9 +27,8 @@ export function appConfigFactory(injector:Injector, appConfig: AppConfig, oauthS
 | 
			
		||||
        return new Promise<boolean>((res) => { res(true); })
 | 
			
		||||
      };
 | 
			
		||||
      oauthService.setupAutomaticSilentRefresh();
 | 
			
		||||
      let router = injector.get(Router);
 | 
			
		||||
      var urlTree = router.parseUrl(window.location.href);
 | 
			
		||||
      var urlPath = window.location.pathname;
 | 
			
		||||
      let location = injector.get(Location);
 | 
			
		||||
      var urlPath =location.path();
 | 
			
		||||
      oauthService.loadDiscoveryDocument().then(() => {
 | 
			
		||||
        oauthService.tryLogin({
 | 
			
		||||
          onTokenReceived: (info) => {
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,6 @@ export class AppConfig {
 | 
			
		||||
 | 
			
		||||
  public load(): Promise<any> {
 | 
			
		||||
    var url = this.location.prepareExternalUrl('/configuration.json');
 | 
			
		||||
    if(url.startsWith("#"))  url='file:///android_asset/www/configuration.json';   // hack for cordova
 | 
			
		||||
    return this.httpClient.get(url)
 | 
			
		||||
      .toPromise()
 | 
			
		||||
      .then(data => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user