mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01: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",
|
"clientSecret": "testClientSecret",
|
||||||
"redirectUri": "http://127.0.0.1/fake/callback"
|
"redirectUri": "http://127.0.0.1/fake/callback"
|
||||||
},
|
},
|
||||||
"minReputationToSubmitFiller": -1
|
"minReputationToSubmitFiller": -1,
|
||||||
|
"minUserIDLength": 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,5 +66,6 @@
|
||||||
{
|
{
|
||||||
"name": "vipUsers"
|
"name": "vipUsers"
|
||||||
}]
|
}]
|
||||||
}
|
},
|
||||||
|
"minUserIDLength": 30 // minimum length of UserID to be accepted
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,8 @@ addDefaults(config, {
|
||||||
},
|
},
|
||||||
gumroad: {
|
gumroad: {
|
||||||
productPermalinks: ["sponsorblock"]
|
productPermalinks: ["sponsorblock"]
|
||||||
}
|
},
|
||||||
|
minUserIDLength: 30
|
||||||
});
|
});
|
||||||
loadFromEnv(config);
|
loadFromEnv(config);
|
||||||
migrate(config);
|
migrate(config);
|
||||||
|
|
|
@ -325,7 +325,7 @@ export async function vote(ip: IPAddress, UUID: SegmentUUID, paramUserID: UserID
|
||||||
return { status: 400 };
|
return { status: 400 };
|
||||||
}
|
}
|
||||||
// Ignore this vote, invalid
|
// Ignore this vote, invalid
|
||||||
if (paramUserID.length < 30 && config.mode !== "test") {
|
if (paramUserID.length < config.minUserIDLength) {
|
||||||
return { status: 200 };
|
return { status: 200 };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,8 @@ export interface SBSConfig {
|
||||||
}
|
}
|
||||||
gumroad: {
|
gumroad: {
|
||||||
productPermalinks: string[],
|
productPermalinks: string[],
|
||||||
}
|
},
|
||||||
|
minUserIDLength: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WebhookConfig {
|
export interface WebhookConfig {
|
||||||
|
|
Loading…
Reference in a new issue