I don't know if this is a valid workaround, but i...
# flutter
m
I don't know if this is a valid workaround, but it works. This is the function I used to recover session on my splash screen. If the recoverSession method return null, means that catch a GoTrueError, I show the login, and store a new "persistSessionString". Hope it can helps 🙂
Copy code
Future<void> recoverSession(BuildContext context, session) async {
    final prefs = await SharedPreferences.getInstance();
    final response = await client.auth.recoverSession(session);
    if (response.data != null) {
      prefs.setString(
          StorageKeys.USER_SESSION, response.data!.persistSessionString);
      Navigator.pushReplacementNamed(context, '/home');
    } else {
      Navigator.pushReplacementNamed(context, '/login');
    }
  }