migrated timetable integration from WebUntis to the MarianumConnect API, implementing a Dio-based client with bearer token authentication, background session validation, and auto-refresh logic.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../../../api/marianumconnect/queries/auth_logout/auth_logout.dart';
|
||||
import '../../../../model/account_data.dart';
|
||||
import '../../../../state/app/modules/account/bloc/account_bloc.dart';
|
||||
import '../../../../state/app/modules/account/bloc/account_state.dart';
|
||||
@@ -31,10 +32,18 @@ class AccountSection extends StatelessWidget {
|
||||
title: 'Abmelden?',
|
||||
content: 'Möchtest du dich wirklich abmelden?',
|
||||
confirmButton: 'Abmelden',
|
||||
onConfirmAsync: AccountData().removeData,
|
||||
onConfirmAsync: _performLogout,
|
||||
),
|
||||
);
|
||||
if (confirmed != true || !context.mounted) return;
|
||||
context.read<AccountBloc>().setStatus(AccountStatus.loggedOut);
|
||||
}
|
||||
|
||||
// Best-effort revoke of the MC bearer token before we wipe local credentials.
|
||||
// The token storage itself is cleared inside AuthLogout regardless of network
|
||||
// success, so an offline logout still gets us into a clean local state.
|
||||
Future<void> _performLogout() async {
|
||||
await AuthLogout().run();
|
||||
await AccountData().removeData();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user