mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 15:11:12 -05:00
feat: Implement comprehensive error logging
This commit is contained in:
@@ -12,8 +12,7 @@ import { Separator } from '@/components/ui/separator';
|
||||
import { Zap, Mail, Lock, User, AlertCircle, Eye, EyeOff } from 'lucide-react';
|
||||
import { supabase } from '@/lib/supabaseClient';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { getErrorMessage } from '@/lib/errorHandler';
|
||||
import { logger } from '@/lib/logger';
|
||||
import { getErrorMessage, handleNonCriticalError } from '@/lib/errorHandler';
|
||||
import { TurnstileCaptcha } from '@/components/auth/TurnstileCaptcha';
|
||||
import { notificationService } from '@/lib/notificationService';
|
||||
import { StorageWarning } from '@/components/auth/StorageWarning';
|
||||
@@ -181,8 +180,6 @@ export default function Auth() {
|
||||
// Reset CAPTCHA widget to force fresh token generation
|
||||
setSignInCaptchaKey(prev => prev + 1);
|
||||
|
||||
logger.error('[Auth] Sign in error', { error });
|
||||
|
||||
// Enhanced error messages
|
||||
const errorMsg = getErrorMessage(error);
|
||||
let errorMessage = errorMsg;
|
||||
@@ -294,16 +291,23 @@ export default function Auth() {
|
||||
|
||||
// Register user with Novu (non-blocking)
|
||||
if (data.user) {
|
||||
const userId = data.user.id;
|
||||
notificationService.createSubscriber({
|
||||
subscriberId: data.user.id,
|
||||
subscriberId: userId,
|
||||
email: formData.email,
|
||||
firstName: formData.username, // Send username as firstName to Novu
|
||||
data: {
|
||||
username: formData.username,
|
||||
}
|
||||
}).catch(err => {
|
||||
logger.error('Failed to register Novu subscriber', { error: err });
|
||||
// Don't block signup if Novu registration fails
|
||||
handleNonCriticalError(err, {
|
||||
action: 'Register Novu subscriber',
|
||||
userId,
|
||||
metadata: {
|
||||
email: formData.email,
|
||||
context: 'post_signup'
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user