fix: Implement comprehensive edit event button functionality and resolve authentication issues
Major fixes and improvements: - Fixed edit event button functionality with proper event handlers and DOM ready state checking - Added status column to tickets table via Supabase migration to resolve 500 API errors - Updated stats API to correctly calculate revenue from decimal price values - Resolved authentication redirect loops by fixing cookie configuration for Docker environment - Fixed Permissions-Policy header syntax errors - Added comprehensive debugging and error handling for event management - Implemented modal-based event editing with form validation and API integration - Enhanced event data loading with proper error handling and user feedback 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
62
test-supabase-connection.js
Normal file
62
test-supabase-connection.js
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Test Supabase Connection from Docker Environment
|
||||
*/
|
||||
|
||||
import { createClient } from '@supabase/supabase-js';
|
||||
|
||||
const supabaseUrl = 'https://zctjaivtfyfxokfaemek.supabase.co';
|
||||
const supabaseAnonKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpjdGphaXZ0ZnlmeG9rZmFlbWVrIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTA4NjU1MjEsImV4cCI6MjA2NjQ0MTUyMX0.IBgyGY7WzLL77ru-_JtThSdAnXFmsNLkKdvK0omGssY';
|
||||
|
||||
const supabase = createClient(supabaseUrl, supabaseAnonKey);
|
||||
|
||||
console.log('Testing Supabase connection...');
|
||||
console.log('URL:', supabaseUrl);
|
||||
console.log('Key (first 20 chars):', supabaseAnonKey.substring(0, 20) + '...');
|
||||
|
||||
// Test authentication
|
||||
async function testLogin() {
|
||||
try {
|
||||
const { data, error } = await supabase.auth.signInWithPassword({
|
||||
email: 'tmartinez@gmail.com',
|
||||
password: 'Skittles@420',
|
||||
});
|
||||
|
||||
console.log('\n--- Login Test Results ---');
|
||||
if (error) {
|
||||
console.log('❌ Login failed:', error.message);
|
||||
console.log('Error details:', error);
|
||||
} else {
|
||||
console.log('✅ Login successful!');
|
||||
console.log('User ID:', data.user?.id);
|
||||
console.log('User email:', data.user?.email);
|
||||
console.log('Session access token (first 20 chars):', data.session?.access_token?.substring(0, 20) + '...');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('❌ Connection error:', err);
|
||||
}
|
||||
}
|
||||
|
||||
// Test basic connection
|
||||
async function testConnection() {
|
||||
try {
|
||||
// Try to fetch from a public table or make a basic query
|
||||
const { data, error } = await supabase
|
||||
.from('events')
|
||||
.select('count')
|
||||
.limit(1);
|
||||
|
||||
console.log('\n--- Connection Test Results ---');
|
||||
if (error) {
|
||||
console.log('❌ Connection failed:', error.message);
|
||||
} else {
|
||||
console.log('✅ Connection successful!');
|
||||
console.log('Query result:', data);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('❌ Connection error:', err);
|
||||
}
|
||||
}
|
||||
|
||||
// Run tests
|
||||
await testConnection();
|
||||
await testLogin();
|
||||
Reference in New Issue
Block a user