Added Email for Supabase
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user