Update sample app
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good

This commit is contained in:
Willem Dantuma 2019-12-19 13:41:59 +01:00
parent 560c426bc0
commit fd8025c674
4 changed files with 40 additions and 10 deletions

12
package-lock.json generated
View File

@ -1943,9 +1943,9 @@
} }
}, },
"@farmmaps/common": { "@farmmaps/common": {
"version": "0.0.1-prerelease.91", "version": "0.0.1-prerelease.95",
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common/-/common-0.0.1-prerelease.91.tgz", "resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common/-/common-0.0.1-prerelease.95.tgz",
"integrity": "sha512-VNhuNqk5CG8ha7fCK7zcVEaqQNp3KUiInuiXE6AnoRcteA9kixcy//yLIjFr3EXGISIOo6MonThJhvFT+GNeyQ==", "integrity": "sha512-PETioME5FcknpL5HNvh2mfjo4/DFnbCRWjZZfRNIt7W4tunJ2UHFkQxkS2IvVTtbHFSK/qUrKB0wBCdySRx8ng==",
"requires": { "requires": {
"angular-oauth2-oidc": "^8.0.2", "angular-oauth2-oidc": "^8.0.2",
"ngx-uploadx": "^3.3.2", "ngx-uploadx": "^3.3.2",
@ -1953,9 +1953,9 @@
} }
}, },
"@farmmaps/common-map": { "@farmmaps/common-map": {
"version": "0.0.1-prerelease.91", "version": "0.0.1-prerelease.95",
"resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map/-/common-map-0.0.1-prerelease.91.tgz", "resolved": "https://repository.akkerweb.nl/repository/npm-group/@farmmaps/common-map/-/common-map-0.0.1-prerelease.95.tgz",
"integrity": "sha512-W8mdCRyLXC3YXbb21K8K6rgq2NVj+EB2oDNLJ1k/UdvLxr+KWlqjRsIh358+cul5VvtLGRqnfiU5oiKHhVGP0A==", "integrity": "sha512-VFKe+P19aJ/gBu0dvhBt/w9VdNmfrWsvYgISZo26M+PEt6hgKW6P9Yyrp8ha64eCWgGGtaDQcwGWLFOHhmP/0w==",
"requires": { "requires": {
"ngx-openlayers": "1.0.0-next.13", "ngx-openlayers": "1.0.0-next.13",
"ol": "^6.0.0", "ol": "^6.0.0",

View File

@ -20,8 +20,8 @@
"@angular/platform-browser-dynamic": "~8.2.14", "@angular/platform-browser-dynamic": "~8.2.14",
"@angular/router": "~8.2.14", "@angular/router": "~8.2.14",
"@aspnet/signalr": "^1.1.4", "@aspnet/signalr": "^1.1.4",
"@farmmaps/common": ">=0.0.1-prerelease.91 <0.0.1", "@farmmaps/common": ">=0.0.1-prerelease.95 <0.0.1",
"@farmmaps/common-map": ">=0.0.1-prerelease.91 <0.0.1", "@farmmaps/common-map": ">=0.0.1-prerelease.95 <0.0.1",
"@ng-bootstrap/ng-bootstrap": "^4.2.1", "@ng-bootstrap/ng-bootstrap": "^4.2.1",
"@ngrx/effects": "^8.2.0", "@ngrx/effects": "^8.2.0",
"@ngrx/router-store": "^8.2.0", "@ngrx/router-store": "^8.2.0",

View File

@ -6,7 +6,7 @@ import {
} from '@angular/core'; } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { AppCommonModule,AppCommonServiceModule } from '@farmmaps/common'; import { AppCommonModule,AppCommonServiceModule,AuthConfigFactory } from '@farmmaps/common';
import { AppCommonMapModule} from '@farmmaps/common-map'; import { AppCommonMapModule} from '@farmmaps/common-map';
import {AppRootComponent} from './app.component'; import {AppRootComponent} from './app.component';
@ -18,6 +18,8 @@ import { StoreRouterConnectingModule} from '@ngrx/router-store';
import {AppRoutingModule} from './app-routing.module'; import {AppRoutingModule} from './app-routing.module';
import { LogoComponent } from './logo/logo.component'; import { LogoComponent } from './logo/logo.component';
import { MenuComponent } from './menu/menu.component'; import { MenuComponent } from './menu/menu.component';
import { LocalAuthconfigFactory} from './localAuthconfigFactory';
import { AuthConfig } from 'angular-oauth2-oidc';
export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects'); export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects');
@ -59,7 +61,13 @@ export function provideBootstrapEffects(effects: Type<any>[]) {
StoreModule.forRoot({}), StoreModule.forRoot({}),
EffectsModule.forRoot([]) EffectsModule.forRoot([])
], ],
providers: [], providers: [
AuthConfigFactory
// {
// provide:AuthConfigFactory,
// useClass:LocalAuthconfigFactory
// }
],
bootstrap: [AppRootComponent] bootstrap: [AppRootComponent]
}) })
export class AppModule { } export class AppModule { }

View File

@ -0,0 +1,22 @@
import {IAuthconfigFactory,AppConfig} from '@farmmaps/common';
import {AuthConfig} from 'angular-oauth2-oidc';
export class LocalAuthconfigFactory implements IAuthconfigFactory {
getAuthConfig(appConfig:AppConfig): AuthConfig {
let authConfig: AuthConfig = new AuthConfig();
authConfig.issuer = appConfig.getConfig("issuer");
authConfig.redirectUri = window.location.origin + "/cb";
authConfig.silentRefreshRedirectUri = window.location.origin + "/silent-refresh.html";
authConfig.clientId = appConfig.getConfig("clientId");
authConfig.customQueryParams = { audience: appConfig.getConfig("audience") };
authConfig.scope = "openid profile email";
authConfig.oidc = true;
authConfig.disableAtHashCheck = true;
authConfig.openUri = uri => {
window.alert("OK "+uri);
}
authConfig.requireHttps = appConfig.getConfig("requireHttps");
return authConfig;
}
}