diff --git a/apps/server-asset-sg/src/core/middleware/jwt.middleware.ts b/apps/server-asset-sg/src/core/middleware/jwt.middleware.ts index 89582cc3..28395ea5 100644 --- a/apps/server-asset-sg/src/core/middleware/jwt.middleware.ts +++ b/apps/server-asset-sg/src/core/middleware/jwt.middleware.ts @@ -190,7 +190,7 @@ export class JwtMiddleware implements NestMiddleware { if (!('username' in payload) || payload.username.length === 0) { throw new HttpException('invalid JWT payload: missing username', 401); } - const email = payload.username.split('_')[1]; + const email = payload.username.split('_').slice(1).join(''); if (email == null || !/^.+@.+\..+$/.test(email)) { throw new HttpException('invalid JWT payload: username does not contain an email', 401); } diff --git a/libs/asset-viewer/src/lib/components/map/map.component.ts b/libs/asset-viewer/src/lib/components/map/map.component.ts index 4450b9a1..4882c9d2 100644 --- a/libs/asset-viewer/src/lib/components/map/map.component.ts +++ b/libs/asset-viewer/src/lib/components/map/map.component.ts @@ -146,15 +146,9 @@ export class MapComponent implements AfterViewInit, OnChanges, OnDestroy { this.subscription.add( studies$.subscribe((studies) => { this.controller.setStudies(studies); + setTimeout(() => this.initializeEnd.emit()); }) ); - - this.controller.isInitialized$ - .pipe( - first(identity), - switchMap(() => studies$) - ) - .subscribe(() => this.initializeEnd.emit()); } private initializeStoreBindings() {