diff --git a/frontend/src/app/features/content/shared/preview-button.component.ts b/frontend/src/app/features/content/shared/preview-button.component.ts index 8da47700c..2568b0273 100644 --- a/frontend/src/app/features/content/shared/preview-button.component.ts +++ b/frontend/src/app/features/content/shared/preview-button.component.ts @@ -8,7 +8,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { take } from 'rxjs/operators'; -import { ContentDto, interpolate, LocalStoreService, ModalModel, SchemaDto, Settings, StatefulComponent } from '@app/shared'; +import { AuthService, ContentDto, interpolate, LocalStoreService, ModalModel, SchemaDto, Settings, StatefulComponent } from '@app/shared'; interface State { // The name of the selected preview config. @@ -37,6 +37,7 @@ export class PreviewButtonComponent extends StatefulComponent implements public dropdown = new ModalModel(); constructor(changeDetector: ChangeDetectorRef, + private readonly authService: AuthService, private readonly localStore: LocalStoreService, ) { super(changeDetector, { @@ -74,7 +75,11 @@ export class PreviewButtonComponent extends StatefulComponent implements } private navigateTo(name: string) { - const url = interpolate(this.schema.previewUrls[name], this.content, 'iv'); + const vars = { ...this.content }; + + vars['accessToken'] = this.authService.user?.accessToken; + + const url = interpolate(this.schema.previewUrls[name], vars, 'iv'); window.open(url, '_blank'); } diff --git a/frontend/src/app/features/content/shared/references/reference-item.component.html b/frontend/src/app/features/content/shared/references/reference-item.component.html index 32c63be56..386dc88bd 100644 --- a/frontend/src/app/features/content/shared/references/reference-item.component.html +++ b/frontend/src/app/features/content/shared/references/reference-item.component.html @@ -49,10 +49,6 @@ - - - - + + + +