Fixes ssr

parent f0bf500a
...@@ -34,68 +34,68 @@ ...@@ -34,68 +34,68 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^6.0.2", "@angular/animations": "^6.1.1",
"@angular/common": "^6.0.2", "@angular/common": "^6.1.1",
"@angular/compiler": "^6.0.2", "@angular/compiler": "^6.1.1",
"@angular/core": "^6.0.2", "@angular/core": "^6.1.1",
"@angular/forms": "^6.0.2", "@angular/forms": "^6.1.1",
"@angular/http": "^6.0.2", "@angular/http": "^6.1.1",
"@angular/platform-browser": "^6.0.2", "@angular/platform-browser": "^6.1.1",
"@angular/platform-browser-dynamic": "^6.0.2", "@angular/platform-browser-dynamic": "^6.1.1",
"@angular/platform-server": "^6.0.2", "@angular/platform-server": "^6.1.1",
"@angular/router": "^6.0.2", "@angular/router": "^6.1.1",
"@angular/service-worker": "^6.0.2", "@angular/service-worker": "^6.1.1",
"@ng-bootstrap/ng-bootstrap": "^2.0.0-alpha.0", "@ng-bootstrap/ng-bootstrap": "^2.2.1",
"@ng-bootstrap/schematics": "^2.0.0-alpha.1", "@ng-bootstrap/schematics": "^2.0.0-alpha.1",
"@nguniversal/express-engine": "^6.0.0", "@nguniversal/express-engine": "^6.0.0",
"@nguniversal/module-map-ngfactory-loader": "^6.0.0", "@nguniversal/module-map-ngfactory-loader": "^6.0.0",
"@ngx-translate/core": "^10.0.1", "@ngx-translate/core": "^10.0.2",
"@ngx-translate/http-loader": "~3.0.1", "@ngx-translate/http-loader": "~3.0.1",
"@techiediaries/ngx-qrcode": "0.0.5", "@techiediaries/ngx-qrcode": "0.0.5",
"angulartics2": "^6.1.0", "angulartics2": "^6.2.0",
"bootstrap": "^4.1.1", "bootstrap": "^4.1.3",
"chrome-launcher": "^0.10.2", "chrome-launcher": "^0.10.2",
"classlist.js": "^1.1.20150312", "classlist.js": "^1.1.20150312",
"cors": "^2.8.4", "cors": "^2.8.4",
"highlight.js": "^9.12.0", "highlight.js": "^9.12.0",
"intro.js": "^2.9.3", "intro.js": "^2.9.3",
"marked": "git+https://github.com/trayhem/marked.git", "marked": "git+https://github.com/trayhem/marked.git",
"messageformat": "^2.0.2", "messageformat": "^2.0.4",
"ngx-qrcode2": "^0.1.0", "ngx-qrcode2": "^0.1.0",
"ngx-translate-messageformat-compiler": "^4.1.1", "ngx-translate-messageformat-compiler": "^4.1.3",
"rxjs": "^6.1.0", "rxjs": "^6.2.2",
"ts-loader": "^4.3.0", "ts-loader": "^4.3.0",
"zone.js": "^0.8.26", "zone.js": "^0.8.26",
"@auth0/angular-jwt": "latest" "@auth0/angular-jwt": "2.0.0"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^0.6.3", "@angular-devkit/build-angular": "^0.7.2",
"@angular/cli": "^6.0.3", "@angular/cli": "^6.1.2",
"@angular/compiler-cli": "^6.0.2", "@angular/compiler-cli": "^6.1.1",
"@angular/language-service": "^6.0.2", "@angular/language-service": "^6.1.1",
"@types/intro.js": "^2.4.3", "@types/intro.js": "^2.4.3",
"@types/jasmine": "~2.8.7", "@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3", "@types/jasminewd2": "~2.0.3",
"@types/node": "^10.1.1", "@types/node": "^10.5.5",
"@types/webpack": "~4.4.0", "@types/webpack": "~4.4.9",
"arsnova-click-v2-types": "git+https://git.thm.de/arsnova/arsnova-click-v2-types.git", "arsnova-click-v2-types": "git+https://git.thm.de/arsnova/arsnova-click-v2-types.git",
"chrome-remote-interface": "^0.25.6", "chrome-remote-interface": "^0.26.1",
"codelyzer": "^4.3.0", "codelyzer": "^4.4.2",
"gm": "^1.23.1", "gm": "^1.23.1",
"http-server": "^0.11.1", "http-server": "^0.11.1",
"imagemin": "^5.3.1", "imagemin": "^5.3.1",
"imagemin-pngquant": "^5.1.0", "imagemin-pngquant": "^5.1.0",
"jasmine-core": "~3.1.0", "jasmine-core": "~3.1.0",
"jasmine-spec-reporter": "~4.2.1", "jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.2", "karma": "~2.0.5",
"karma-chrome-launcher": "~2.2.0", "karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.0", "karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2", "karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^1.1.0", "karma-jasmine-html-reporter": "^1.2.0",
"karma-mocha-reporter": "^2.2.5", "karma-mocha-reporter": "^2.2.5",
"karma-phantomjs-launcher": "^1.0.4", "karma-phantomjs-launcher": "^1.0.4",
"minimist": "^1.2.0", "minimist": "^1.2.0",
"protractor": "^5.3.2", "protractor": "^5.4.0",
"purify-css": "~1.2.5", "purify-css": "~1.2.5",
"ts-node": "~6.0.3", "ts-node": "~6.0.3",
"tsickle": ">=0.25.5", "tsickle": ">=0.25.5",
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
...@@ -33,9 +34,16 @@ describe('I18nManagerOverviewComponent', () => { ...@@ -33,9 +34,16 @@ describe('I18nManagerOverviewComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), HttpClientTestingModule, NgbModalModule.forRoot(), SharedModule, PipesModule, RouterTestingModule, HttpClientModule, TranslateModule.forRoot({ }),
HttpClientTestingModule,
NgbModalModule.forRoot(),
SharedModule,
PipesModule,
RouterTestingModule,
HttpClientModule,
TranslateModule.forRoot({
loader: { loader: {
provide: TranslateLoader, provide: TranslateLoader,
useFactory: ( useFactory: (
......
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { jwtOptionsFactory } from '../../../lib/jwt.factory'; import { jwtOptionsFactory } from '../../../lib/jwt.factory';
...@@ -22,7 +23,7 @@ describe('KeyOutputComponent', () => { ...@@ -22,7 +23,7 @@ describe('KeyOutputComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, PipesModule, }), SharedModule, PipesModule,
], ],
......
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { NgbActiveModal, NgbModalModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbActiveModal, NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
...@@ -21,7 +22,7 @@ describe('AddModeComponent', () => { ...@@ -21,7 +22,7 @@ describe('AddModeComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, NgbModalModule.forRoot(), }), SharedModule, NgbModalModule.forRoot(),
], ],
......
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, TestBed } from '@angular/core/testing'; import { async, TestBed } from '@angular/core/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { jwtOptionsFactory } from '../../../lib/jwt.factory'; import { jwtOptionsFactory } from '../../../lib/jwt.factory';
...@@ -21,7 +22,7 @@ describe('FilterKeysPipe', () => { ...@@ -21,7 +22,7 @@ describe('FilterKeysPipe', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), HttpClientTestingModule, }), HttpClientTestingModule,
], ],
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
...@@ -62,7 +63,7 @@ describe('QuizJoinComponent', () => { ...@@ -62,7 +63,7 @@ describe('QuizJoinComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({ }), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: { loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
...@@ -42,7 +43,7 @@ describe('QuizManagerComponent', () => { ...@@ -42,7 +43,7 @@ describe('QuizManagerComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), HttpClientTestingModule, SharedModule, RouterTestingModule, HttpClientModule, FooterModule, TranslateModule.forRoot({ }), HttpClientTestingModule, SharedModule, RouterTestingModule, HttpClientModule, FooterModule, TranslateModule.forRoot({
loader: { loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
...@@ -86,7 +87,7 @@ describe('QuizOverviewComponent', () => { ...@@ -86,7 +87,7 @@ describe('QuizOverviewComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({ }), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: { loader: {
......
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { NgModule } from '@angular/core'; import { NgModule, PLATFORM_ID } from '@angular/core';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
...@@ -132,7 +132,7 @@ export const appRoutes: Routes = [ ...@@ -132,7 +132,7 @@ export const appRoutes: Routes = [
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), }),
], ],
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
...@@ -53,7 +54,7 @@ describe('HomeComponent', () => { ...@@ -53,7 +54,7 @@ describe('HomeComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({ }), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: { loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
...@@ -30,7 +31,7 @@ describe('LoginComponent', () => { ...@@ -30,7 +31,7 @@ describe('LoginComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, FormsModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({ }), SharedModule, FormsModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: { loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
...@@ -38,7 +39,7 @@ describe('NicknameInputComponent', () => { ...@@ -38,7 +39,7 @@ describe('NicknameInputComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({ }), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: { loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from '@angular/platform-browser';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
...@@ -39,7 +40,7 @@ describe('NicknameSelectComponent', () => { ...@@ -39,7 +40,7 @@ describe('NicknameSelectComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({ }), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: { loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
...@@ -46,7 +47,7 @@ describe('RootComponent', () => { ...@@ -46,7 +47,7 @@ describe('RootComponent', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({ }), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: { loader: {
......
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { inject, TestBed } from '@angular/core/testing'; import { inject, TestBed } from '@angular/core/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { jwtOptionsFactory } from '../../../lib/jwt.factory'; import { jwtOptionsFactory } from '../../../lib/jwt.factory';
...@@ -17,7 +18,7 @@ describe('LanguageLoaderService', () => { ...@@ -17,7 +18,7 @@ describe('LanguageLoaderService', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), HttpClientTestingModule, }), HttpClientTestingModule,
], ],
......
import { HttpClientModule } from '@angular/common/http'; import { HttpClientModule } from '@angular/common/http';
import { PLATFORM_ID } from '@angular/core';
import { async, inject, TestBed } from '@angular/core/testing'; import { async, inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
...@@ -19,7 +20,7 @@ describe('CasLoginService', () => { ...@@ -19,7 +20,7 @@ describe('CasLoginService', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, RouterTestingModule, HttpClientModule, }), SharedModule, RouterTestingModule, HttpClientModule,
], ],
......
import { PLATFORM_ID } from '@angular/core';
import { inject, TestBed } from '@angular/core/testing'; import { inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
...@@ -18,7 +19,7 @@ describe('StaticLoginService', () => { ...@@ -18,7 +19,7 @@ describe('StaticLoginService', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, RouterTestingModule, }), SharedModule, RouterTestingModule,
], ],
......
import { HttpClient, HttpClientModule } from '@angular/common/http'; import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing'; import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { inject, TestBed } from '@angular/core/testing'; import { inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
...@@ -23,7 +24,7 @@ describe('ProjectLoaderService', () => { ...@@ -23,7 +24,7 @@ describe('ProjectLoaderService', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), HttpClientTestingModule, SharedModule, RouterTestingModule, HttpClientModule, TranslateModule.forRoot({ }), HttpClientTestingModule, SharedModule, RouterTestingModule, HttpClientModule, TranslateModule.forRoot({
loader: { loader: {
......
import { HttpClientModule } from '@angular/common/http'; import { HttpClientModule } from '@angular/common/http';
import { PLATFORM_ID } from '@angular/core';
import { async, inject, TestBed } from '@angular/core/testing'; import { async, inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt'; import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
...@@ -18,7 +19,7 @@ describe('UserService', () => { ...@@ -18,7 +19,7 @@ describe('UserService', () => {
jwtOptionsProvider: { jwtOptionsProvider: {
provide: JWT_OPTIONS, provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory, useFactory: jwtOptionsFactory,
deps: [StorageService], deps: [PLATFORM_ID, StorageService],
}, },
}), SharedModule, RouterTestingModule, HttpClientModule, }), SharedModule, RouterTestingModule, HttpClientModule,
], ],
......
import { isPlatformServer } from '@angular/common';
import { StorageService } from '../app/service/storage/storage.service'; import { StorageService } from '../app/service/storage/storage.service';
import { DB_TABLE, STORAGE_KEY } from '../app/shared/enums'; import { DB_TABLE, STORAGE_KEY } from '../app/shared/enums';
export function jwtOptionsFactory(storageService: StorageService): any { export function jwtOptionsFactory(platformId, storageService: StorageService): any {
return { return {
tokenGetter: async () => { tokenGetter: async () => {
if (isPlatformServer(platformId)) {
return null;
}
const tokens = await storageService.read(DB_TABLE.CONFIG, STORAGE_KEY.TOKEN).toPromise();