Jake Vanderwerf
2026-01-02 e6287fd606e6e3220261fd68c394989e6ade0f90
inc/managers/LoginManager.php
@@ -872,7 +872,9 @@
      ob_start();
      ?>
      document.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', async function () {
      window.auth.subscribe(event => {
         if (event === 'auth-loaded') {
         const form = document.querySelector('.login form');
         if (!form) return;
@@ -912,12 +914,8 @@
         try {
            submit.disabled = true;
            submit.textContent = 'Loading...';
            const response = await fetch(`${jvbSettings.api}<?=($action === 'magic') ? $action : 'auth/'.$action?>`, {
               const response = await window.auth.fetch(`${jvbSettings.api}auth/<?php echo $action; ?>`, {
               method: 'POST',
               headers: {
                     'Content-Type': 'application/json',
                  'X-WP-Nonce': window.auth.getNonce()
               },
               body: JSON.stringify(realFormData)
            });
@@ -947,7 +945,7 @@
               if (result.redirect) {
                  setTimeout(() => {
                     window.location.href = result.redirect;
                  }, 200); // Brief delay to show success message
                     }, 100); // Brief delay to show success message
               }
            } catch (error) {
@@ -962,6 +960,8 @@
               submit.disabled = false;
            }
         }
         }
      });
      });