add "Not Authorized" notice to Backblaze Uploader

montage-api
Moe 2021-12-25 16:08:50 -08:00
parent e4b7098386
commit 6d0d606ad5
1 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,10 @@ module.exports = function(s,config,lang){
b2.listBuckets().then(function(resp){
var buckets = resp.buckets
var bucketN = -2
if(!buckets){
s.userLog({mid:'$USER',ke:e.ke},{type: lang['Backblaze Error'],msg: lang['Not Authorized']})
return
}
buckets.forEach(function(item,n){
if(item.bucketName === userDetails.bb_b2_bucket){
bucketN = n