diff --git a/.replit b/.replit index f7d564d0..d3cd2656 100644 --- a/.replit +++ b/.replit @@ -35,10 +35,6 @@ outputType = "webview" localPort = 5000 externalPort = 80 -[[ports]] -localPort = 32851 -externalPort = 3001 - [[ports]] localPort = 34277 externalPort = 3000 diff --git a/backend/static/js/alpine-components.js b/backend/static/js/alpine-components.js index 723a0764..0c238994 100644 --- a/backend/static/js/alpine-components.js +++ b/backend/static/js/alpine-components.js @@ -375,8 +375,6 @@ Alpine.data('authModal', (defaultMode = 'login') => ({ this.resetForms(); } }); - - // No need for event listeners since x-init handles global exposure }, async fetchSocialProviders() { @@ -620,44 +618,6 @@ Alpine.store('toast', { }); console.log('All Alpine.js components registered successfully'); - - // Ensure global authModal is available immediately - if (typeof window !== 'undefined') { - // Create a simple proxy that will find the authModal component when called - window.authModal = { - show: (mode = 'login') => { - console.log('Attempting to show auth modal:', mode); - - // Find the authModal component in the DOM - const modalEl = document.querySelector('[x-data*="authModal"]'); - if (modalEl && modalEl._x_dataStack && modalEl._x_dataStack[0]) { - const component = modalEl._x_dataStack[0]; - if (component.show && typeof component.show === 'function') { - component.show(mode); - console.log('Auth modal opened successfully'); - return; - } - } - - // Fallback: try to find any component with a show method - const elements = document.querySelectorAll('[x-data]'); - for (let el of elements) { - if (el._x_dataStack) { - for (let stack of el._x_dataStack) { - if (stack.show && stack.mode !== undefined) { - stack.show(mode); - console.log('Auth modal opened via fallback method'); - return; - } - } - } - } - - console.error('Could not find authModal component to open'); - } - }; - console.log('Global authModal proxy created'); - } } // Try multiple registration approaches diff --git a/backend/templates/components/auth/auth-modal.html b/backend/templates/components/auth/auth-modal.html index 98848845..b8c3137a 100644 --- a/backend/templates/components/auth/auth-modal.html +++ b/backend/templates/components/auth/auth-modal.html @@ -12,10 +12,9 @@ Matches React frontend AuthDialog functionality with modal-based auth x-data="authModal" x-show="open" x-cloak - x-init="window.authModal = $data; console.log('Auth modal initialized and exposed globally')" + x-init="window.authModal = $data" class="fixed inset-0 z-50 flex items-center justify-center" @keydown.escape.window="close()" - style="display: none;" >