Return homepage if is already logined when visit login page.

Store cookies information to cookies subdirectory on Windows
This commit is contained in:
2023-08-31 13:15:08 +08:00
parent 6f3a400ed8
commit f0ff06fb3e
4 changed files with 52 additions and 5 deletions

View File

@@ -9,6 +9,8 @@ class AuthInfo {
ServerStatus? _status;
ServerStatus? get status => _status;
bool get isAuthed => (_user != null);
bool _checked = false;
bool get checked => _checked;
Future<void> getServerStatus() async {
_status = (await api.getStatus()).unwrap();
@@ -21,6 +23,7 @@ class AuthInfo {
} else {
_user = null;
}
_checked = true;
await getServerStatus();
return re.ok;
}