diff --git a/src/app/features/home/details/details.page.ts b/src/app/features/home/details/details.page.ts index 625545721..22f976df6 100644 --- a/src/app/features/home/details/details.page.ts +++ b/src/app/features/home/details/details.page.ts @@ -379,16 +379,20 @@ export class DetailsPage { } private openCaptureClub() { - return this.activeDetailedCapture$ - .pipe( - first(), + combineLatest([ + this.activeDetailedCapture$.pipe( switchMap( activeDetailedCapture => activeDetailedCapture.diaBackendAsset$ ), - isNonNullable(), - concatMap(diaBackendAsset => + isNonNullable() + ), + this.diaBackendAuthService.token$, + ]) + .pipe( + first(), + concatMap(([diaBackendAsset, token]) => Browser.open({ - url: `https://captureclub.cc/asset?mid=${diaBackendAsset.id}`, + url: `https://captureclub.cc/asset?mid=${diaBackendAsset.id}&token=${token}`, toolbarColor: '#564dfc', }) ), diff --git a/src/app/features/home/home.page.ts b/src/app/features/home/home.page.ts index d63a779d1..781a0b0ba 100644 --- a/src/app/features/home/home.page.ts +++ b/src/app/features/home/home.page.ts @@ -12,6 +12,7 @@ import { first, map, startWith, + switchMap, tap, } from 'rxjs/operators'; import { CameraService } from '../../shared/camera/camera.service'; @@ -196,10 +197,18 @@ export class HomePage { } // eslint-disable-next-line class-methods-use-this - async openCaptureClub() { - return Browser.open({ - url: 'https://captureclub.cc/', - toolbarColor: '#564dfc', - }); + openCaptureClub() { + this.diaBackendAuthService.token$ + .pipe( + first(), + switchMap(token => + Browser.open({ + url: `https://captureclub.cc/?token=${token}`, + toolbarColor: '#564dfc', + }) + ), + untilDestroyed(this) + ) + .subscribe(); } }