mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-05-10 18:06:08 +02:00
add minUserIDLength config option
This commit is contained in:
parent
cff2325aef
commit
2683c61995
5 changed files with 9 additions and 5 deletions
3
ci.json
3
ci.json
|
@ -76,5 +76,6 @@
|
|||
"clientSecret": "testClientSecret",
|
||||
"redirectUri": "http://127.0.0.1/fake/callback"
|
||||
},
|
||||
"minReputationToSubmitFiller": -1
|
||||
"minReputationToSubmitFiller": -1,
|
||||
"minUserIDLength": 0
|
||||
}
|
||||
|
|
|
@ -66,5 +66,6 @@
|
|||
{
|
||||
"name": "vipUsers"
|
||||
}]
|
||||
}
|
||||
},
|
||||
"minUserIDLength": 30 // minimum length of UserID to be accepted
|
||||
}
|
||||
|
|
|
@ -166,7 +166,8 @@ addDefaults(config, {
|
|||
},
|
||||
gumroad: {
|
||||
productPermalinks: ["sponsorblock"]
|
||||
}
|
||||
},
|
||||
minUserIDLength: 30
|
||||
});
|
||||
loadFromEnv(config);
|
||||
migrate(config);
|
||||
|
|
|
@ -325,7 +325,7 @@ export async function vote(ip: IPAddress, UUID: SegmentUUID, paramUserID: UserID
|
|||
return { status: 400 };
|
||||
}
|
||||
// Ignore this vote, invalid
|
||||
if (paramUserID.length < 30 && config.mode !== "test") {
|
||||
if (paramUserID.length < config.minUserIDLength) {
|
||||
return { status: 200 };
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,8 @@ export interface SBSConfig {
|
|||
}
|
||||
gumroad: {
|
||||
productPermalinks: string[],
|
||||
}
|
||||
},
|
||||
minUserIDLength: number
|
||||
}
|
||||
|
||||
export interface WebhookConfig {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue