recoverPersistedSession static method
Recover the persisted session from disk
Implementation
static Future<bool> recoverPersistedSession() async {
final box = Hive.box(_boxName);
if (box.containsKey(_sessionInfoKey)) {
final sessionInfo = box.get(_sessionInfoKey);
final response = await auth.recoverSession(sessionInfo);
if (response.error != null) {
return false;
} else {
final valid = response.data is Session;
if (valid) {
_authController.add(AuthChangeEvent.signedIn);
}
return valid;
}
}
return false;
}