mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 20:31:14 -05:00
Refactor Novu registration to frontend
This commit is contained in:
@@ -12,6 +12,7 @@ import { Zap, Mail, Lock, User, AlertCircle, Eye, EyeOff } from 'lucide-react';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { TurnstileCaptcha } from '@/components/auth/TurnstileCaptcha';
|
||||
import { notificationService } from '@/lib/notificationService';
|
||||
export default function Auth() {
|
||||
const [searchParams] = useSearchParams();
|
||||
const navigate = useNavigate();
|
||||
@@ -140,6 +141,21 @@ export default function Auth() {
|
||||
});
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
// Register user with Novu (non-blocking)
|
||||
if (data.user) {
|
||||
notificationService.createSubscriber({
|
||||
subscriberId: data.user.id,
|
||||
email: formData.email,
|
||||
firstName: formData.displayName || formData.username,
|
||||
data: {
|
||||
username: formData.username,
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('Failed to register Novu subscriber:', err);
|
||||
// Don't block signup if Novu registration fails
|
||||
});
|
||||
}
|
||||
|
||||
toast({
|
||||
title: "Welcome to ThrillWiki!",
|
||||
|
||||
Reference in New Issue
Block a user