Fix 401 detection on import videos
This commit is contained in:
parent
61b3e146e1
commit
b6fe1f985c
|
@ -148,7 +148,7 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag
|
||||||
try {
|
try {
|
||||||
await uploadVideo(program['url'], accessToken, videoAttributes)
|
await uploadVideo(program['url'], accessToken, videoAttributes)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.message.indexOf('401')) {
|
if (err.message.indexOf('401') !== -1) {
|
||||||
console.log('Got 401 Unauthorized, token may have expired, renewing token and retry.')
|
console.log('Got 401 Unauthorized, token may have expired, renewing token and retry.')
|
||||||
|
|
||||||
const res = await login(program['url'], client, user)
|
const res = await login(program['url'], client, user)
|
||||||
|
|
Loading…
Reference in New Issue