forked from Outils-PeerTube/peertube-plugin-auto-import-ytb
Fix b2b04df23b
requestAuthToken was set to async but he wasn't waited for his usage.
This commit is contained in:
parent
f579afab16
commit
ae195d9170
|
@ -27,7 +27,7 @@ class PeerTubeRequester {
|
||||||
this.password = config.password;
|
this.password = config.password;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async requestAuthToken(): Promise<void> {
|
private async requestAuthToken(): Promise<any> {
|
||||||
let response = await fetch(
|
let response = await fetch(
|
||||||
new URL(`/api/v1/oauth-clients/local`, this.domain_name)
|
new URL(`/api/v1/oauth-clients/local`, this.domain_name)
|
||||||
);
|
);
|
||||||
|
@ -60,7 +60,7 @@ class PeerTubeRequester {
|
||||||
}
|
}
|
||||||
|
|
||||||
async uploadFromUrl(message: UploadInstruction): Promise<void> {
|
async uploadFromUrl(message: UploadInstruction): Promise<void> {
|
||||||
const accessToken = this.requestAuthToken();
|
const accessToken = await this.requestAuthToken();
|
||||||
const myUploadForm = new URLSearchParams();
|
const myUploadForm = new URLSearchParams();
|
||||||
const myHeader = new Headers();
|
const myHeader = new Headers();
|
||||||
myHeader.append("Authorization", `Bearer ${accessToken}`);
|
myHeader.append("Authorization", `Bearer ${accessToken}`);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user