More migration fixes

This commit is contained in:
Willem Dantuma 2020-04-01 16:11:44 +02:00
parent 511f1f4731
commit 80ddf816b0
10 changed files with 43 additions and 59 deletions

View File

@ -4,10 +4,10 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"elm-pep": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/elm-pep/-/elm-pep-1.0.6.tgz",
"integrity": "sha512-1DJ6ReFk8+GtgoqRiEhBo28K69Rxe9Bfc7h16+1VMQT2KlCuPBYj5W33OYa2AZpqkuqCBLhcNzO10zxJVakapA=="
"@openlayers/pepjs": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/@openlayers/pepjs/-/pepjs-0.5.3.tgz",
"integrity": "sha512-Bgvi5c14BS0FJWyYWWFstNEnXsB30nK8Jt8hkAAdqr7E0gDdBBWVDglF3Ub19wTxvgJ/CVHyTY6VuCtnyRzglg=="
},
"ieee754": {
"version": "1.1.13",
@ -23,11 +23,11 @@
}
},
"ol": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/ol/-/ol-6.2.1.tgz",
"integrity": "sha512-CT2szew/COd7Zf9Bls+pdzewBYZNgyfxFivJ3L4Jv9Th7JdWjcQAT+pqMPH25L9SbVT+T17RCMq2H2m9uBCl1A==",
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/ol/-/ol-6.1.1.tgz",
"integrity": "sha512-0dL3i3eJqgOpqIjDKEY3grkeQnjAYfV5L/JCxhOu4SxiaizRwFrFgeas6LILRoxKa03jhQFbut2r2bbgcLGQeA==",
"requires": {
"elm-pep": "^1.0.4",
"@openlayers/pepjs": "^0.5.3",
"pbf": "3.2.1",
"pixelworks": "1.1.0",
"rbush": "^3.0.1"

View File

@ -6,7 +6,7 @@
},
"dependencies": {
"ngx-openlayers": "1.0.0-next.13",
"ol": "6.2.1"
"ol": "6.1.1"
},
"peerDependencies": {
"@angular/core": "^9.1.0",

View File

@ -22,7 +22,8 @@
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
"enableResourceInlining": true,
"enableIvy": false
},
"exclude": [
"src/test.ts",

View File

@ -1,6 +0,0 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

View File

@ -38,8 +38,6 @@ export class AuthGuard implements CanActivate, CanLoad, CanActivateChild {
checkLogin(url: string): boolean {
if (!this.oauthService.hasValidAccessToken()) {
this.oauthService.responseType
if(this.oauthService.responseType == "code")
if(this.oauthService.getRefreshToken() != null ) {
this.oauthService.refreshToken().then(() => {
this.store.dispatch(new appCommonActions.InitUser());
@ -53,9 +51,6 @@ export class AuthGuard implements CanActivate, CanLoad, CanActivateChild {
this.oauthService.initCodeFlow(url);
return false;
}
else
this.oauthService.initImplicitFlow(url);
return false;
} else {
this.store.dispatch(new appCommonActions.InitUser());
return true;

View File

@ -1,7 +1,7 @@
import { Injector } from '@angular/core';
import { Location} from '@angular/common';
import { Router,UrlSerializer } from '@angular/router';
import { AuthConfig, OAuthService, JwksValidationHandler, OAuthErrorEvent, OAuthStorage } from 'angular-oauth2-oidc';
import { AuthConfig, OAuthService, OAuthErrorEvent, OAuthStorage } from 'angular-oauth2-oidc';
import { AppConfig } from "./app.config";
import {ItemTypeService} from '../services/itemtype.service';
import { IAuthconfigFactory } from './authconfigFactory';
@ -26,21 +26,12 @@ export function appConfigFactory(injector:Injector, appConfig: AppConfig, oauthS
});
oauthService.configure(authconfigFactory.getAuthConfig(appConfig));
oauthService.setStorage(authStorage);
oauthService.tokenValidationHandler = new JwksValidationHandler();
oauthService.tokenValidationHandler.validateAtHash = function () {
return new Promise<boolean>((res) => { res(true); })
};
oauthService.setupAutomaticSilentRefresh();
let location = injector.get(Location);
let router = injector.get(Router);
let urlPath = location.path();
oauthService.loadDiscoveryDocument().then(() => {
oauthService.tryLogin({
onTokenReceived: (info) => {
urlPath = info.state;
}
}).then(() => {
router.navigateByUrl(urlPath);
oauthService.tryLoginCodeFlow().then(() => {
router.navigateByUrl(decodeURIComponent(oauthService.state));
});
})
}).then(() => {

View File

@ -29,7 +29,8 @@
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"enableResourceInlining": true
"enableResourceInlining": true,
"enableIvy": false
},
"exclude": [
"src/test.ts",

View File

@ -1,6 +0,0 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

View File

@ -61,7 +61,12 @@ export function provideBootstrapEffects(effects: Type<any>[]) {
AppCommonServiceModule.forRoot(),
AppCommonMapModule.forRoot(),
BrowserModule,
StoreModule.forRoot({}),
StoreModule.forRoot({},{runtimeChecks: { // TODO fix this should all be true
strictStateImmutability: false,
strictActionImmutability: false,
strictStateSerializability: false,
strictActionSerializability: false
}}),
EffectsModule.forRoot([])
],
providers: [

View File

@ -10,5 +10,8 @@
],
"include": [
"src/**/*.d.ts"
]
],
"angularCompilerOptions": {
"enableIvy": false
}
}