diff --git a/frontend/lib/main.dart b/frontend/lib/main.dart index 735acff6..b63cfb0f 100644 --- a/frontend/lib/main.dart +++ b/frontend/lib/main.dart @@ -125,6 +125,11 @@ final _router = GoRouter( _routerLogger.fine("Redirect check - Path: $path, IsLoggedIn: $isLoggedIn"); + // 0. ALWAYS allow /verify/ to proceed so it can signal the backend + if (path.startsWith('/verify/')) { + return null; + } + // If not logged in and trying to access a protected page, redirect to /login if (!isLoggedIn && !isPublicPath) { _routerLogger.info("Not logged in, redirecting to /login"); @@ -132,7 +137,7 @@ final _router = GoRouter( } // If logged in and trying to access login page, redirect to root (dashboard) - if (isLoggedIn && (path == '/login' || path.startsWith('/verify/'))) { + if (isLoggedIn && path == '/login') { _routerLogger.info("Logged in, redirecting to /"); return '/'; }