added support for web ; bumped dart_core_sdk version to 1.13.2

This commit is contained in:
2026-06-24 17:05:42 +02:00
parent fff5617757
commit 3efe4dcca6
20 changed files with 734 additions and 30 deletions

View File

@@ -28,15 +28,26 @@ class ReflexRouterDelegate extends RouterDelegate
_init() async {
try {
await authService.init();
loggedIn = await authService.isLoggedIn();
bool isAuthenticated = await authService.isLoggedIn();
// If the access token check failed but we have a refresh token,
// try to silently renew before forcing the user back to the login screen.
if (!isAuthenticated &&
authService.refreshToken != null &&
authService.refreshToken!.isNotEmpty) {
try {
await authService.doRefreshToken();
authService.tokenRefresher = TokenRefresher(authService,
refreshInterval: const Duration(seconds: 60));
authService.tokenRefresher!.start();
isAuthenticated = await authService.isLoggedIn();
} catch (_) {
// Refresh token is expired or invalid — full re-login required.
}
}
loggedIn = isAuthenticated;
} catch (e) {
showDialog(
context: navigatorKey.currentContext!,
builder: (context) => AlertDialog(
title: Text('Error'),
content: Text('Error: $e'),
),
);
loggedIn = false;
}
}