Add checkSessionExist in auth

This commit is contained in:
Moe Poi ~ 2022-05-12 18:13:10 +07:00
parent 4ebf6b27ba
commit d76d6135e9

View file

@ -19,6 +19,16 @@ Future<void> addSession(userId, sessionToken) async {
await prefs.setString('session', session);
}
Future<bool> checkSessionExist() async {
final prefs = await SharedPreferences.getInstance();
if (prefs.containsKey('session')) {
return true;
}
return false;
}
Future<void> removeSession() async {
final prefs = await SharedPreferences.getInstance();