Session sign-out and sign-back-in issues with records from the database
- 0
- Databases
- Flutter
- Auth
- Cloud
Session sign-out and sign-back-in issues with records from the database
In a Flutter application I am testing signing a user in, you can see the user’s records. Sign out and Sign back in. The user’s records do not show. But if you close the app or refresh the app in the simulator, the data shows up. I am testing with an iOS Simulator and iOS Device with the same results
I traced the database queries and they are being executed.
I traced the session and it’s removed, and then the correct session gets set again. It’s like the Database queries still think the session is not there, but the trace shows the correct session.
Sign out:
Future<void> signOut() async {
if (_currentUser == null || _currentSession == null) {
print('signOut error: User is not authenticated');
return;
}
try {
// Delete all sessions
// await _account.deleteSession(sessionId: 'current');
final result = await _account.deleteSessions();
print('signOut result: $result');
_currentUser = null;
_currentSession = null;
_authStateController.add(null);
print('signOut success');
} catch (e) {
print('signOut error: $e');
}
}
Sign in:
Future<Session?> signInWithEmailAndPassword({
required String email,
required String password,
}) async {
try {
// Create a new session
final Session session = await _account.createEmailPasswordSession(
email: email,
password: password,
);
debugPrint('signInWithEmailAndPassword: ${session.userId}');
_currentUser = await getCurrentUser();
_currentSession = session;
_authStateController.add(session);
return session;
} on AppwriteException catch (e) {
debugPrint('signInWithEmailAndPassword error 1: $e');
return null;
}
}
Any thoughts?
Recommended threads
- Bulk API limitations in self-hosted serv...
Environment: Appwrite Selfhost SDK: node-appwrite 28.0 Calling `upsertRows` (also applies to `createRows`/`updateRows`/`deleteRows`) with more than 100 rows fa...
- Getting current user has been blocked
Getting current user has been blocked error while signing in the appwrite console. Got this during I am testing with the my saas web project. Please help to unb...
- Android SDK: Kotlin null Value Not Updat...
Hi team, I think you should check the Android SDK implementation once, as it seems to have an issue handling Kotlin **null** values. For example: When I send:...