implemented a comprehensive client-side demo mode triggered by a "demo@" username prefix, serving curated fixture data for all app modules

This commit is contained in:
2026-07-07 20:24:16 +02:00
parent 2668b111f1
commit 9b74c9fd81
45 changed files with 1409 additions and 43 deletions
@@ -14,6 +14,9 @@ class SessionValidator {
required Future<void> Function() onInvalidated,
}) async {
if (!AccountData().isPopulated()) return;
// AuthVerify uses its own dio (bypassing the demo interceptor), so a demo
// session must be skipped here or its missing token would 401 into a logout.
if (AccountData().isDemo) return;
final username = AccountData().getUsername();
final password = AccountData().getPassword();
try {
@@ -1,5 +1,6 @@
import 'package:dio/dio.dart';
import '../demo/demo_marianumconnect_interceptor.dart';
import 'auth/auth_interceptor.dart';
/// Singleton dio instance for the Marianum-Connect mobile API. Wired with the
@@ -24,6 +25,7 @@ class MarianumConnectApi {
contentType: 'application/json',
),
);
dio.interceptors.add(DemoMarianumConnectInterceptor());
dio.interceptors.add(MarianumConnectAuthInterceptor());
return dio;
}