Added Email for Supabase

This commit is contained in:
2025-09-03 13:34:10 +02:00
parent a9ec8562dd
commit 96687f2210
27 changed files with 4421 additions and 386 deletions

View File

@@ -267,23 +267,31 @@
// Check authentication and load dashboard
async function initDashboard() {
try {
// Temporarily disable auth check for design testing
// const { data: { session }, error } = await supabase.auth.getSession();
// Get current session
const { data: { session }, error } = await supabase.auth.getSession();
// if (error) {
// console.error('Error checking authentication:', error);
// window.location.href = '/login';
// return;
// }
if (error) {
console.error('Error checking authentication:', error);
// Temporarily show dashboard for testing
displayUserInfo({ email: 'admin@speedrun-arena.com' });
showDashboard();
return;
}
// if (!session) {
// // No session, redirect to login
// window.location.href = '/login';
// return;
// }
if (!session) {
// No session, redirect to login
window.location.href = '/login';
return;
}
// User is authenticated, show dashboard
displayUserInfo({ email: 'admin@speedrun-arena.com' });
if (session.user) {
console.log('User data:', session.user);
displayUserInfo(session.user);
} else {
// Fallback if no user data
displayUserInfo({ email: 'admin@speedrun-arena.com' });
}
showDashboard();
} catch (error) {