added validation on every USE_DB_AUTHENTICATION call

This commit is contained in:
rafaelsideguide
2024-08-12 14:20:41 -03:00
parent ba2af74adf
commit bbed6ef23d
11 changed files with 24 additions and 12 deletions
+2 -1
View File
@@ -36,7 +36,8 @@ export class ScrapeEvents {
static async insert(jobId: string, content: ScrapeEvent) {
if (jobId === "TEST") return null;
if (process.env.USE_DB_AUTHENTICATION) {
const useDbAuthentication = process.env.USE_DB_AUTHENTICATION === 'true';
if (useDbAuthentication) {
try {
const result = await supabase.from("scrape_events").insert({
job_id: jobId,