mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 16:31:13 -05:00
Refactor: Secure email confirmation flow
This commit is contained in:
@@ -117,15 +117,8 @@ export function EmailChangeDialog({ open, onOpenChange, currentEmail, userId }:
|
||||
|
||||
if (updateError) throw updateError;
|
||||
|
||||
// Step 3: Update Novu subscriber (non-blocking)
|
||||
if (notificationService.isEnabled()) {
|
||||
notificationService.updateSubscriber({
|
||||
subscriberId: userId,
|
||||
email: data.newEmail,
|
||||
}).catch(error => {
|
||||
console.error('Failed to update Novu subscriber:', error);
|
||||
});
|
||||
}
|
||||
// Step 3: Novu subscriber will be updated automatically after both emails are confirmed
|
||||
// This happens in the useAuth hook when the email change is fully verified
|
||||
|
||||
// Step 4: Log the email change attempt
|
||||
supabase.from('admin_audit_log').insert({
|
||||
|
||||
Reference in New Issue
Block a user