instance whitelist

This commit is contained in:
Kay Faraday 2024-07-29 15:40:20 -07:00
parent 465b63e440
commit 02e7eddf7b
1 changed files with 24 additions and 0 deletions

View File

@ -174,6 +174,30 @@ app.get("/callback", RateLimiter.HIGH, async (req, res) => {
const [username, hostname] = whoami.sub.split("@");
const whitelistedInstances = [
"cannibal.cafe",
"cottoncandy.cafe",
"eepy.express",
"imouto.exposed",
"mapsupport.de",
"my.thoughtcrimes.top",
"nnia.space",
"oddballs.online",
"rape.pet",
"tummy.town",
];
if (!whitelistedInstances.includes(hostname)) {
res.redirect(
"/" +
buildQuery({
TYPE: "banned",
ERROR_DESC: "instance not whitelisted",
})
);
return;
}
const instance = await Instance.fromAuth(
hostname,
whoami.instance.instance