import 'dart:developer' as developer; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'app.dart'; import 'core/auth/auth_controller.dart'; import 'core/config/url_strategy.dart'; import 'version.g.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); // Use path-based URLs on web (no-op on mobile/desktop) configureUrlStrategy(); developer.log( '${AppVersion.name} v${AppVersion.fullVersion}', name: 'tatlock_ui', ); // Initialize auth before starting the app. // This handles OIDC callback and silent auth on web. // If it returns false, we're redirecting and shouldn't continue. final authReady = await AuthController.initialize(); if (!authReady) { developer.log('Auth redirecting, not starting app', name: 'tatlock_ui'); return; // Don't run the app - browser is redirecting } runApp(const ProviderScope(child: TatlockApp())); }