Various improvements #3

Merged
amaury.joly merged 16 commits from various-improvements into master 2021-07-27 18:39:49 +02:00
Showing only changes of commit ae195d9170 - Show all commits

View File

@ -27,7 +27,7 @@ class PeerTubeRequester {
this.password = config.password;
}
private async requestAuthToken(): Promise<void> {
private async requestAuthToken(): Promise<any> {
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<void> {
const accessToken = this.requestAuthToken();
const accessToken = await this.requestAuthToken();
const myUploadForm = new URLSearchParams();
const myHeader = new Headers();
myHeader.append("Authorization", `Bearer ${accessToken}`);