Added central user credentials management

This commit is contained in:
2023-06-11 18:18:37 +02:00
parent 04c244503e
commit 1521056217
22 changed files with 207 additions and 159 deletions

View File

@ -2,8 +2,7 @@ import 'dart:async';
import 'dart:convert';
import 'dart:developer';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../../model/accountData.dart';
import '../../webuntisApi.dart';
import 'authenticateParams.dart';
import 'authenticateResponse.dart';
@ -28,12 +27,10 @@ class Authenticate extends WebuntisApi {
static AuthenticateResponse? _lastResponse;
static Future<void> createSession() async {
SharedPreferences preferences = await SharedPreferences.getInstance();
_lastResponse = await Authenticate(
AuthenticateParams(
user: preferences.getString("username")!,
password: preferences.getString("password")!,
user: AccountData().getUsername(),
password: AccountData().getPassword(),
)
).run();
}