         });
                
                console.log('Join API response status:', response.status);
                
                if (!response.ok) {
                    if (response.status === 401) {
                        // Auth token expired or invalid
                        localStorage.removeItem('authToken');
                        sessionStorage.setItem('pendingJoinConversation', conversationId);
                        window.location.href = '/static/index.html';
                        