Fixes ssr

parent f0bf500a
Pipeline #18350 passed with stages
in 9 minutes and 44 seconds
......@@ -34,68 +34,68 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^6.0.2",
"@angular/common": "^6.0.2",
"@angular/compiler": "^6.0.2",
"@angular/core": "^6.0.2",
"@angular/forms": "^6.0.2",
"@angular/http": "^6.0.2",
"@angular/platform-browser": "^6.0.2",
"@angular/platform-browser-dynamic": "^6.0.2",
"@angular/platform-server": "^6.0.2",
"@angular/router": "^6.0.2",
"@angular/service-worker": "^6.0.2",
"@ng-bootstrap/ng-bootstrap": "^2.0.0-alpha.0",
"@angular/animations": "^6.1.1",
"@angular/common": "^6.1.1",
"@angular/compiler": "^6.1.1",
"@angular/core": "^6.1.1",
"@angular/forms": "^6.1.1",
"@angular/http": "^6.1.1",
"@angular/platform-browser": "^6.1.1",
"@angular/platform-browser-dynamic": "^6.1.1",
"@angular/platform-server": "^6.1.1",
"@angular/router": "^6.1.1",
"@angular/service-worker": "^6.1.1",
"@ng-bootstrap/ng-bootstrap": "^2.2.1",
"@ng-bootstrap/schematics": "^2.0.0-alpha.1",
"@nguniversal/express-engine": "^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",
"@techiediaries/ngx-qrcode": "0.0.5",
"angulartics2": "^6.1.0",
"bootstrap": "^4.1.1",
"angulartics2": "^6.2.0",
"bootstrap": "^4.1.3",
"chrome-launcher": "^0.10.2",
"classlist.js": "^1.1.20150312",
"cors": "^2.8.4",
"highlight.js": "^9.12.0",
"intro.js": "^2.9.3",
"marked": "git+https://github.com/trayhem/marked.git",
"messageformat": "^2.0.2",
"messageformat": "^2.0.4",
"ngx-qrcode2": "^0.1.0",
"ngx-translate-messageformat-compiler": "^4.1.1",
"rxjs": "^6.1.0",
"ngx-translate-messageformat-compiler": "^4.1.3",
"rxjs": "^6.2.2",
"ts-loader": "^4.3.0",
"zone.js": "^0.8.26",
"@auth0/angular-jwt": "latest"
"@auth0/angular-jwt": "2.0.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.6.3",
"@angular/cli": "^6.0.3",
"@angular/compiler-cli": "^6.0.2",
"@angular/language-service": "^6.0.2",
"@angular-devkit/build-angular": "^0.7.2",
"@angular/cli": "^6.1.2",
"@angular/compiler-cli": "^6.1.1",
"@angular/language-service": "^6.1.1",
"@types/intro.js": "^2.4.3",
"@types/jasmine": "~2.8.7",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^10.1.1",
"@types/webpack": "~4.4.0",
"@types/node": "^10.5.5",
"@types/webpack": "~4.4.9",
"arsnova-click-v2-types": "git+https://git.thm.de/arsnova/arsnova-click-v2-types.git",
"chrome-remote-interface": "^0.25.6",
"codelyzer": "^4.3.0",
"chrome-remote-interface": "^0.26.1",
"codelyzer": "^4.4.2",
"gm": "^1.23.1",
"http-server": "^0.11.1",
"imagemin": "^5.3.1",
"imagemin-pngquant": "^5.1.0",
"jasmine-core": "~3.1.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.2",
"karma": "~2.0.5",
"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-html-reporter": "^1.1.0",
"karma-jasmine-html-reporter": "^1.2.0",
"karma-mocha-reporter": "^2.2.5",
"karma-phantomjs-launcher": "^1.0.4",
"minimist": "^1.2.0",
"protractor": "^5.3.2",
"protractor": "^5.4.0",
"purify-css": "~1.2.5",
"ts-node": "~6.0.3",
"tsickle": ">=0.25.5",
......
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
......@@ -33,9 +34,16 @@ describe('I18nManagerOverviewComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
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: {
provide: TranslateLoader,
useFactory: (
......
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { jwtOptionsFactory } from '../../../lib/jwt.factory';
......@@ -22,7 +23,7 @@ describe('KeyOutputComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, PipesModule,
],
......
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { NgbActiveModal, NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
......@@ -21,7 +22,7 @@ describe('AddModeComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, NgbModalModule.forRoot(),
],
......
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, TestBed } from '@angular/core/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { jwtOptionsFactory } from '../../../lib/jwt.factory';
......@@ -21,7 +22,7 @@ describe('FilterKeysPipe', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), HttpClientTestingModule,
],
......
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { ActivatedRoute, Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
......@@ -62,7 +63,7 @@ describe('QuizJoinComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
......@@ -42,7 +43,7 @@ describe('QuizManagerComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), HttpClientTestingModule, SharedModule, RouterTestingModule, HttpClientModule, FooterModule, TranslateModule.forRoot({
loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
......@@ -86,7 +87,7 @@ describe('QuizOverviewComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: {
......
import { CommonModule } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { NgModule } from '@angular/core';
import { NgModule, PLATFORM_ID } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
......@@ -132,7 +132,7 @@ export const appRoutes: Routes = [
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}),
],
......
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { DomSanitizer } from '@angular/platform-browser';
import { Router } from '@angular/router';
......@@ -53,7 +54,7 @@ describe('HomeComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { Router } from '@angular/router';
......@@ -30,7 +31,7 @@ describe('LoginComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, FormsModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { Router } from '@angular/router';
import { RouterTestingModule } from '@angular/router/testing';
......@@ -38,7 +39,7 @@ describe('NicknameInputComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { async, ComponentFixture, inject, TestBed } from '@angular/core/testing';
import { DomSanitizer } from '@angular/platform-browser';
import { Router } from '@angular/router';
......@@ -39,7 +40,7 @@ describe('NicknameSelectComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: {
......
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
......@@ -46,7 +47,7 @@ describe('RootComponent', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, RouterTestingModule, HttpClientModule, HttpClientTestingModule, TranslateModule.forRoot({
loader: {
......
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { inject, TestBed } from '@angular/core/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
import { jwtOptionsFactory } from '../../../lib/jwt.factory';
......@@ -17,7 +18,7 @@ describe('LanguageLoaderService', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), HttpClientTestingModule,
],
......
import { HttpClientModule } from '@angular/common/http';
import { PLATFORM_ID } from '@angular/core';
import { async, inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
......@@ -19,7 +20,7 @@ describe('CasLoginService', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, RouterTestingModule, HttpClientModule,
],
......
import { PLATFORM_ID } from '@angular/core';
import { inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
......@@ -18,7 +19,7 @@ describe('StaticLoginService', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, RouterTestingModule,
],
......
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { PLATFORM_ID } from '@angular/core';
import { inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
......@@ -23,7 +24,7 @@ describe('ProjectLoaderService', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), HttpClientTestingModule, SharedModule, RouterTestingModule, HttpClientModule, TranslateModule.forRoot({
loader: {
......
import { HttpClientModule } from '@angular/common/http';
import { PLATFORM_ID } from '@angular/core';
import { async, inject, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { JWT_OPTIONS, JwtModule } from '@auth0/angular-jwt';
......@@ -18,7 +19,7 @@ describe('UserService', () => {
jwtOptionsProvider: {
provide: JWT_OPTIONS,
useFactory: jwtOptionsFactory,
deps: [StorageService],
deps: [PLATFORM_ID, StorageService],
},
}), SharedModule, RouterTestingModule, HttpClientModule,
],
......
import { isPlatformServer } from '@angular/common';
import { StorageService } from '../app/service/storage/storage.service';
import { DB_TABLE, STORAGE_KEY } from '../app/shared/enums';
export function jwtOptionsFactory(storageService: StorageService): any {
export function jwtOptionsFactory(platformId, storageService: StorageService): any {
return {
tokenGetter: async () => {
if (isPlatformServer(platformId)) {
return null;
}
const tokens = await storageService.read(DB_TABLE.CONFIG, STORAGE_KEY.TOKEN).toPromise();
return tokens ? tokens.staticLoginToken : null;
......
......@@ -4,7 +4,7 @@ const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: {server: './server.ts'},
resolve: {extensions: ['.js', '.ts', '.json', '.mjs'], modules: [path.resolve('node_modules')]},
resolve: {extensions: ['.js', '.ts', '.json', '.mjs']},
target: 'node',
node: {
__dirname: false,
......@@ -12,9 +12,7 @@ module.exports = {
},
mode: 'none',
// this makes sure we include node_modules and other 3rd party libraries
externals: [/node_modules/, nodeExternals({
whitelist: [/^arsnova-click-v2-types/]
})],
externals: [/node_modules/],
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].js'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment