diff --git a/lib/peertubeRequester.ts b/lib/peertubeRequester.ts index a2c2cbf..9e58271 100644 --- a/lib/peertubeRequester.ts +++ b/lib/peertubeRequester.ts @@ -27,7 +27,7 @@ class PeerTubeRequester { this.password = config.password; } - private async requestAuthToken(): Promise { + private async requestAuthToken(): Promise { let response = await fetch( new URL(`/api/v1/oauth-clients/local`, this.domain_name) ); @@ -60,7 +60,7 @@ class PeerTubeRequester { } async uploadFromUrl(message: UploadInstruction): Promise { - const accessToken = this.requestAuthToken(); + const accessToken = await this.requestAuthToken(); const myUploadForm = new URLSearchParams(); const myHeader = new Headers(); myHeader.append("Authorization", `Bearer ${accessToken}`);