chore(hackathon): remove console.log statements and improve error handling

- Remove all console.log statements from middleware, layout, and pages
- Replace alert with toast for onboarding error messages
- Delete unused page-original.tsx backup file
- Keep console.error for actual error debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Maulana Sodiqin
2025-11-26 16:26:00 +07:00
co-authored by Claude
parent 7d1b86acdb
commit cdd4fd4703
5 changed files with 5 additions and 118 deletions
-4
View File
@@ -37,8 +37,6 @@ export const middleware = async ({ request }: LoaderFunctionArgs) => {
const url = new URL(request.url);
const pathname = url.pathname;
console.log('[Middleware] Checking route:', pathname);
// Get session from Supabase (authoritative source)
const { data: { session: supabaseSession }, error: sessionError } = await supabase.auth.getSession();
@@ -86,10 +84,8 @@ export const middleware = async ({ request }: LoaderFunctionArgs) => {
let hasLocation = false;
if (cached && (now - cached.timestamp) < CACHE_DURATION) {
console.log('[Middleware] Using cached onboarding status');
hasLocation = cached.hasLocation;
} else {
console.log('[Middleware] Fetching fresh onboarding status');
const { data: userData, error: userError } = await supabase
.from('users')
.select('location')