pollo/app/services/helpers.server.ts

25 lines
484 B
TypeScript
Raw Normal View History

2023-12-15 10:44:20 -07:00
import "dotenv/config";
2023-11-27 15:17:27 -07:00
export const isShit = (email: string) => {
if (!process.env.SHIT_LIST) {
return false;
}
const shitListString = process.env.SHIT_LIST as string;
const shitList = shitListString.split(",");
let result = false;
shitList.forEach((shitItem) => {
if (email.includes(shitItem)) {
console.log(
`🔴 BLOCKED USEREMAIL: ${email}\n🔴 FAILED CONDITION: ${shitItem}`
);
result = true;
}
});
return result;
};