mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 18:11:12 -05:00
Remove debug console logs
This commit is contained in:
@@ -110,7 +110,6 @@ function AuthProviderComponent({ children }: { children: React.ReactNode }) {
|
||||
const currentAal = await getSessionAal(session);
|
||||
setAal(currentAal);
|
||||
authLog('[Auth] Current AAL:', currentAal);
|
||||
console.log('🔐 [Auth] AAL SET:', currentAal); // Explicit console log for debugging
|
||||
} else {
|
||||
setAal(null);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import { useEffect } from 'react';
|
||||
import { logger } from '@/lib/logger';
|
||||
|
||||
export function useCaptchaBypass() {
|
||||
// Single layer: Check if environment allows bypass
|
||||
const bypassEnabled = import.meta.env.VITE_ALLOW_CAPTCHA_BYPASS === 'true';
|
||||
|
||||
// Log warning if bypass is active
|
||||
useEffect(() => {
|
||||
if (bypassEnabled && typeof window !== 'undefined') {
|
||||
console.warn(
|
||||
'⚠️ CAPTCHA BYPASS IS ACTIVE\n' +
|
||||
'CAPTCHA verification is disabled via VITE_ALLOW_CAPTCHA_BYPASS=true\n' +
|
||||
'This should ONLY be enabled in development/preview environments.\n' +
|
||||
'Ensure VITE_ALLOW_CAPTCHA_BYPASS=false in production!'
|
||||
logger.warn(
|
||||
'⚠️ CAPTCHA BYPASS IS ACTIVE - ' +
|
||||
'This should ONLY be enabled in development/preview environments.'
|
||||
);
|
||||
}
|
||||
}, [bypassEnabled]);
|
||||
|
||||
@@ -3,6 +3,7 @@ import { supabase } from '@/integrations/supabase/client';
|
||||
import { toast } from 'sonner';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import type { EntityType, EntityVersion } from '@/types/versioning';
|
||||
import { logger } from '@/lib/logger';
|
||||
|
||||
interface FieldChange {
|
||||
id: string;
|
||||
@@ -123,7 +124,7 @@ export function useEntityVersions(entityType: EntityType, entityId: string) {
|
||||
* @deprecated Use compareVersions() to see field-level changes
|
||||
*/
|
||||
const fetchFieldHistory = async (versionId: string) => {
|
||||
console.warn('fetchFieldHistory is deprecated. Use compareVersions() instead for field-level changes.');
|
||||
logger.warn('fetchFieldHistory is deprecated. Use compareVersions() instead for field-level changes.');
|
||||
setFieldHistory([]);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { useUnitPreferences } from '@/hooks/useUnitPreferences';
|
||||
import { logger } from '@/lib/logger';
|
||||
|
||||
function isLocalStorageAvailable(): boolean {
|
||||
try {
|
||||
@@ -24,11 +25,11 @@ export function useLocationAutoDetect() {
|
||||
// Only run auto-detection after preferences have loaded
|
||||
if (loading) return;
|
||||
|
||||
// Check if localStorage is available
|
||||
if (!isLocalStorageAvailable()) {
|
||||
console.warn('localStorage is not available, skipping location auto-detection');
|
||||
return;
|
||||
}
|
||||
// Check if localStorage is available
|
||||
if (!isLocalStorageAvailable()) {
|
||||
logger.warn('localStorage is not available, skipping location auto-detection');
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if we've already attempted detection
|
||||
const hasAttemptedDetection = localStorage.getItem('location_detection_attempted');
|
||||
|
||||
@@ -435,7 +435,6 @@ export const useModerationQueue = (config?: UseModerationQueueConfig) => {
|
||||
const releaseAfterAction = useCallback(async (submissionId: string, action: 'approved' | 'rejected'): Promise<void> => {
|
||||
if (currentLock?.submissionId === submissionId) {
|
||||
await releaseLock(submissionId, true); // Silent release
|
||||
console.log(`🔓 Auto-released lock after ${action} action`);
|
||||
}
|
||||
}, [currentLock, releaseLock]);
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ export function useProfile(userId: string | undefined) {
|
||||
queryFn: async () => {
|
||||
if (!userId) return null;
|
||||
|
||||
console.log('[useProfile] Fetching filtered profile for userId:', userId);
|
||||
|
||||
// Get current viewer ID
|
||||
const { data: { user } } = await supabase.auth.getUser();
|
||||
const viewerId = user?.id || null;
|
||||
@@ -24,7 +22,6 @@ export function useProfile(userId: string | undefined) {
|
||||
});
|
||||
|
||||
if (error) {
|
||||
console.error('[useProfile] Error:', error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
@@ -46,11 +43,6 @@ export function useProfile(userId: string | undefined) {
|
||||
}
|
||||
}
|
||||
|
||||
console.log('[useProfile] Filtered profile loaded:', {
|
||||
username: profileData.username,
|
||||
has_avatar: !!profileData.avatar_url
|
||||
});
|
||||
|
||||
return profileData;
|
||||
},
|
||||
enabled: !!userId,
|
||||
@@ -61,7 +53,6 @@ export function useProfile(userId: string | undefined) {
|
||||
|
||||
const refreshProfile = () => {
|
||||
if (userId) {
|
||||
console.log('[useProfile] Invalidating profile cache for userId:', userId);
|
||||
queryClient.invalidateQueries({ queryKey: ['profile', userId] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useState, useEffect, useMemo, useCallback } from 'react';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { Park, Ride, Company } from '@/types/database';
|
||||
import { logger } from '@/lib/logger';
|
||||
|
||||
export interface SearchResult {
|
||||
id: string;
|
||||
@@ -67,7 +68,7 @@ export function useSearch(options: UseSearchOptions = {}) {
|
||||
setRecentSearches(parsed);
|
||||
} else {
|
||||
// Invalid format, clear it
|
||||
console.warn('Recent searches data is not an array, clearing');
|
||||
logger.warn('Recent searches data is not an array, clearing');
|
||||
localStorage.removeItem('thrillwiki_recent_searches');
|
||||
}
|
||||
} catch (parseError) {
|
||||
|
||||
Reference in New Issue
Block a user