mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 11:31:11 -05:00
Fix remaining console logs and types
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { serve } from "https://deno.land/std@0.190.0/http/server.ts";
|
||||
import { startRequest, endRequest } from "../_shared/logger.ts";
|
||||
import { startRequest, endRequest, edgeLogger } from "../_shared/logger.ts";
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -127,7 +127,10 @@ const handler = async (req: Request): Promise<Response> => {
|
||||
|
||||
// Check if domain is disposable
|
||||
if (DISPOSABLE_DOMAINS.has(domain)) {
|
||||
console.log(`Blocked disposable email domain: ${domain}`);
|
||||
edgeLogger.info('Blocked disposable email domain', {
|
||||
domain,
|
||||
requestId: tracking.requestId
|
||||
});
|
||||
|
||||
endRequest(tracking, 400, 'Disposable email domain blocked');
|
||||
|
||||
@@ -154,7 +157,10 @@ const handler = async (req: Request): Promise<Response> => {
|
||||
}
|
||||
|
||||
// Email is valid
|
||||
console.log(`Email validated successfully: ${email}`);
|
||||
edgeLogger.info('Email validated successfully', {
|
||||
email,
|
||||
requestId: tracking.requestId
|
||||
});
|
||||
|
||||
endRequest(tracking, 200);
|
||||
|
||||
@@ -173,8 +179,12 @@ const handler = async (req: Request): Promise<Response> => {
|
||||
}
|
||||
);
|
||||
|
||||
} catch (error: any) {
|
||||
console.error('Error in validate-email function:', error);
|
||||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
edgeLogger.error('Error in validate-email function', {
|
||||
error: errorMessage,
|
||||
requestId: tracking.requestId
|
||||
});
|
||||
|
||||
endRequest(tracking, 500, error.message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user