Barkmaster commited on
Commit
c800687
·
verified ·
1 Parent(s): 360e7e2

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +10 -0
index.html CHANGED
@@ -662,6 +662,16 @@ async function doLogin() {
662
  localStorage.setItem('warzone_session', JSON.stringify(authUser));
663
  }
664
 
 
 
 
 
 
 
 
 
 
 
665
  $('login-email').value=''; $('login-password').value='';
666
  await loadData();
667
  goto('dashboard');
 
662
  localStorage.setItem('warzone_session', JSON.stringify(authUser));
663
  }
664
 
665
+ // Call the Edge Function to trigger the email
666
+ fetch(`${SB_URL}/functions/v1/send-login-alert`, {
667
+ method: 'POST',
668
+ headers: {
669
+ 'Authorization': `Bearer ${SB_KEY}`,
670
+ 'Content-Type': 'application/json'
671
+ },
672
+ body: JSON.stringify({ email: authUser.email })
673
+ });
674
+
675
  $('login-email').value=''; $('login-password').value='';
676
  await loadData();
677
  goto('dashboard');