Skip to content

Commit 3e92899

Browse files
committed
feat(details-page): pass tmp token to iframe
1 parent d48d885 commit 3e92899

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/app/features/home/details/details.page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"
5656
>
5757
<div class="slide">
58-
<iframe [src]="iframeUrlWithToken$ | ngrxPush"></iframe>
58+
<iframe [src]="iframeUrlWithJWTToken$ | ngrxPush"></iframe>
5959
</div>
6060
</ng-template>
6161
</swiper>

src/app/features/home/details/details.page.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,22 @@ export class DetailsPage {
213213
})
214214
);
215215

216+
readonly iframeUrlWithJWTToken$ = combineLatest([
217+
this.activeDetailedCapture$,
218+
defer(() => this.diaBackendAuthService.queryJWTToken$()),
219+
]).pipe(
220+
distinctUntilChanged(),
221+
map(([detailedCapture, token]) => {
222+
const params =
223+
`nid=${detailedCapture.id}` +
224+
`&token=${token.access}` +
225+
`&refresh_token=${token.refresh}` +
226+
`&from=mycapture`;
227+
const url = `${BUBBLE_IFRAME_URL}/asset_page?${params}`;
228+
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
229+
})
230+
);
231+
216232
readonly isFromSeriesPage$ = this.type$.pipe(map(type => type === 'series'));
217233

218234
constructor(

0 commit comments

Comments
 (0)