Use location for path
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma 2019-12-23 17:33:43 +01:00
parent 70fb5b42ec
commit 4b232cc0e4
2 changed files with 3 additions and 4 deletions

View File

@ -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) => {

View File

@ -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 => {