Implement login

This commit is contained in:
2024-06-01 14:00:16 +02:00
parent 16d97ad08f
commit d662a6c426
5 changed files with 252 additions and 150 deletions

View File

@@ -58,6 +58,20 @@ class UserAccount extends ChangeNotifier {
notifyListeners();
}
void set(User user, Client client, KeyTokenAuth auth) {
_client = client;
_user = user;
_auth = auth;
notifyListeners();
}
void clear() {
_client = null;
_user = null;
_auth = null;
notifyListeners();
}
void load() {
final uid = Globals().sharedPrefs.getString('auth.userid');
final toka = Globals().sharedPrefs.getString('auth.tokenadmin');