Added central user credentials management
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user